]> git.ipfire.org Git - thirdparty/nqptp.git/commitdiff
Remove some redundant structure members and associated code.
authorMike Brady <4265913+mikebrady@users.noreply.github.com>
Sun, 14 Nov 2021 11:07:44 +0000 (11:07 +0000)
committerMike Brady <4265913+mikebrady@users.noreply.github.com>
Sun, 14 Nov 2021 11:07:44 +0000 (11:07 +0000)
nqptp-clock-sources.h
nqptp-message-handlers.c
nqptp.c

index 54d3bf60db7e5ecea50c6bd5d2c724c02f2204b9..3085ab1cd0beeac677ca71a94c8325f51be76f24 100644 (file)
@@ -44,7 +44,6 @@ typedef struct {
   char ip[64];                         // 64 is nicely aligned and bigger than INET6_ADDRSTRLEN (46)
   int family;                          // AF_INET or AF_INET6
   int announcements_without_followups; // add 1 for every announce, reset with a followup
-  int announcements_sent;              // number of announce messages returned to this clock
   uint64_t clock_id;
   uint64_t local_time; // the local time when the offset was calculated
   uint64_t source_time;
index d5c89a748e4cd0bb502f74a9fbe1bc08aa6c2bc4..31dc9f8218b66d067c16d14910c50cfea3f93d91 100644 (file)
@@ -51,7 +51,6 @@ void handle_control_port_messages(char *buf, ssize_t recv_len,
           if (t == -1)
             t = create_clock_source_record(new_ip, clock_private_info);
           clock_private_info[t].flags |= (1 << clock_is_a_timing_peer);
-          clock_private_info[t].announcements_sent = 0;
         }
       }
 
diff --git a/nqptp.c b/nqptp.c
index 96c1a8f76160f0cf1153e27ebfea949e21aca802..20ab8b0ebe414712fd0cc2e092899c49e5a663ef 100644 (file)
--- a/nqptp.c
+++ b/nqptp.c
@@ -497,18 +497,10 @@ uint64_t broadcasting_task(uint64_t call_time, __attribute__((unused)) void *pri
           // here, we have the destination, so send it
 
           // if (clocks_private[i].family == AF_INET6) {
-          if (clocks_private[i].announcements_sent != 0) {
-            debug(1, "Warning: sending another Announce message to %" PRIx64 "at %s...",
-                  clocks_private[i].clock_id, clocks_private[i].ip);
-          } else {
-            debug(1, "Sending an Announce message to %" PRIx64 "at %s...",
-                  clocks_private[i].clock_id, clocks_private[i].ip);
-          }
           // debug_print_buffer(1, (char *)msg, msg_length);
           int ret = sendto(s, msg, msg_length, 0, res->ai_addr, res->ai_addrlen);
           if (ret == -1)
             debug(1, "result of sendto is %d.", ret);
-          clocks_private[i].announcements_sent++;
           debug(2, "message clock \"%" PRIx64 "\" at %s on %s.", clocks_private[i].clock_id,
                 clocks_private[i].ip, clocks_private[i].family == AF_INET6 ? "IPv6" : "IPv4");