From: Mike Brady <4265913+mikebrady@users.noreply.github.com> Date: Sun, 14 Nov 2021 11:07:44 +0000 (+0000) Subject: Remove some redundant structure members and associated code. X-Git-Tag: 1.2~76 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=512a25127d692cb7e5a73c04f5d4333abb2e3841;p=thirdparty%2Fnqptp.git Remove some redundant structure members and associated code. --- diff --git a/nqptp-clock-sources.h b/nqptp-clock-sources.h index 54d3bf6..3085ab1 100644 --- a/nqptp-clock-sources.h +++ b/nqptp-clock-sources.h @@ -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; diff --git a/nqptp-message-handlers.c b/nqptp-message-handlers.c index d5c89a7..31dc9f8 100644 --- a/nqptp-message-handlers.c +++ b/nqptp-message-handlers.c @@ -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 96c1a8f..20ab8b0 100644 --- 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");