]> git.ipfire.org Git - thirdparty/nqptp.git/commitdiff
Fix some issues suggested by clang-tidy.
authorMike Brady <4265913+mikebrady@users.noreply.github.com>
Thu, 9 Dec 2021 17:36:53 +0000 (17:36 +0000)
committerMike Brady <4265913+mikebrady@users.noreply.github.com>
Thu, 9 Dec 2021 17:36:53 +0000 (17:36 +0000)
nqptp-message-handlers.h
nqptp-utilities.c
nqptp.c

index a0e28656c94de25939d4729dde390b8bb7c9a971..fee940382b8721a1689b0a91b491a53709966092 100644 (file)
@@ -20,6 +20,8 @@
 #ifndef NQPTP_MESSAGE_HANDLERS_H
 #define NQPTP_MESSAGE_HANDLERS_H
 
+#include <sys/types.h>
+#include "general-utilities.h"
 #include "nqptp-clock-sources.h"
 
 void handle_announce(char *buf, ssize_t recv_len, clock_source_private_data *clock_private_info,
index 0629614cea4c78f5f2e8939b86553bfa657f21db..e23ebc301727281bf5550c054637f35acda85b33 100644 (file)
@@ -22,6 +22,7 @@
 #include <errno.h>
 #include <fcntl.h>   // fcntl etc.
 #include <ifaddrs.h> // getifaddrs
+#include <netinet/in.h>
 
 #ifdef CONFIG_FOR_LINUX
 #include <linux/if_packet.h> // sockaddr_ll
@@ -30,7 +31,6 @@
 #ifdef CONFIG_FOR_FREEBSD
 #include <net/if_dl.h>
 #include <net/if_types.h>
-#include <netinet/in.h>
 #include <sys/socket.h>
 #include <unistd.h>
 #endif
diff --git a/nqptp.c b/nqptp.c
index 64f85c6986ce1d44ba33a7730bd6ee661363ed14..31202f368932ee2e3b4034f3909fec8b35e00301 100644 (file)
--- a/nqptp.c
+++ b/nqptp.c
@@ -527,10 +527,12 @@ uint64_t broadcasting_task(uint64_t call_time, __attribute__((unused)) void *pri
     }
   }
 
+/*
   uint64_t announce_interval = 1;
   announce_interval = announce_interval << (8 + aPTPinitialLogAnnounceInterval);
   announce_interval = announce_interval * 1000000000;
   announce_interval = announce_interval >> 8; // nanoseconds
+  return call_time + announce_interval;
+*/
   return call_time + 50000000;
-  // return call_time + announce_interval;
 }