[Git][NTPsec/ntpsec][master] 2 commits: SO_TIMESTAMP, comment that macOS uses this packet option.

Gary E. Miller gitlab at mg.gitlab.com
Thu Jun 8 00:03:25 UTC 2017


Gary E. Miller pushed to branch master at NTPsec / ntpsec


Commits:
b203516b by Gary E. Miller at 2017-06-07T16:45:03-07:00
SO_TIMESTAMP, comment that macOS uses this packet option.

- - - - -
39e8006e by Gary E. Miller at 2017-06-07T16:55:17-07:00
libisc: Condition isc_netaddr_fromin6() and isc_netaddr_islinklocal()

Both are Linux only, no need/use for other OS.

- - - - -


2 changed files:

- libisc/interfaceiter.c
- ntpd/ntp_packetstamp.c


Changes:

=====================================
libisc/interfaceiter.c
=====================================
--- a/libisc/interfaceiter.c
+++ b/libisc/interfaceiter.c
@@ -40,21 +40,8 @@
 #define ISC_TF(x) ((x) ? true : false)
 
 static void
-isc_netaddr_fromin6(isc_netaddr_t *netaddr, const struct in6_addr *ina6);
-
-static void
 isc_netaddr_setzone(isc_netaddr_t *netaddr, uint32_t zone);
 
-static bool
-isc_netaddr_islinklocal(isc_netaddr_t *na) __attribute__((pure));
-
-static void
-isc_netaddr_fromin6(isc_netaddr_t *netaddr, const struct in6_addr *ina6) {
-        memset(netaddr, 0, sizeof(*netaddr));
-        netaddr->family = AF_INET6;
-        netaddr->type.in6 = *ina6;
-}
-
 static void
 isc_netaddr_setzone(isc_netaddr_t *netaddr, uint32_t zone) {
         /* we currently only support AF_INET6. */
@@ -63,21 +50,6 @@ isc_netaddr_setzone(isc_netaddr_t *netaddr, uint32_t zone) {
         netaddr->zone = zone;
 }
 
-/*
- * Returns #true if the address is a link local address.
- */
-static bool
-isc_netaddr_islinklocal(isc_netaddr_t *na) {
-        switch (na->family) {
-        case AF_INET:
-                return (false);
-        case AF_INET6:
-                return (ISC_TF(IN6_IS_ADDR_LINKLOCAL(&na->type.in6)));
-        default:
-                return (false);
-        }
-}
-
 typedef struct {
         unsigned int magic;
 } isc__magic_t;
@@ -1602,6 +1574,34 @@ void internal_first(isc_interfaceiter_t *iter) {
 
 #ifdef __linux
 static void
+isc_netaddr_fromin6(isc_netaddr_t *netaddr, const struct in6_addr *ina6);
+
+static void
+isc_netaddr_fromin6(isc_netaddr_t *netaddr, const struct in6_addr *ina6) {
+        memset(netaddr, 0, sizeof(*netaddr));
+        netaddr->family = AF_INET6;
+        netaddr->type.in6 = *ina6;
+}
+
+/*
+ * Returns #true if the address is a link local address.
+ */
+static bool
+isc_netaddr_islinklocal(isc_netaddr_t *na) __attribute__((pure));
+
+static bool
+isc_netaddr_islinklocal(isc_netaddr_t *na) {
+        switch (na->family) {
+        case AF_INET:
+                return (false);
+        case AF_INET6:
+                return (ISC_TF(IN6_IS_ADDR_LINKLOCAL(&na->type.in6)));
+        default:
+                return (false);
+        }
+}
+
+static void
 linux_if_inet6_first(isc_interfaceiter_t *iter) {
         if (iter->proc != NULL) {
                 rewind(iter->proc);


=====================================
ntpd/ntp_packetstamp.c
=====================================
--- a/ntpd/ntp_packetstamp.c
+++ b/ntpd/ntp_packetstamp.c
@@ -22,7 +22,7 @@
  *   bintime documentation is at
  *   http://phk.freebsd.dk/pubs/timecounter.pdf
  * SO_TIMESTAMPNS/SCM_TIMESTAMPNS  Linux
- * SO_TIMESTAMP/SCM_TIMESTAMP      FreeBSD, NetBSD, OpenBSD, Linux
+ * SO_TIMESTAMP/SCM_TIMESTAMP      FreeBSD, NetBSD, OpenBSD, Linux, macOS
  *
  * Linux supports both SO_TIMESTAMP and SO_TIMESTAMPNS so it's
  * important to check for SO_TIMESTAMPNS first to get the better accuracy.



View it on GitLab: https://gitlab.com/NTPsec/ntpsec/compare/e9e7205ffba934e339ecea41fadb75f2769084a5...39e8006e049bc9d913ff915edcd88f74587349bc

---
View it on GitLab: https://gitlab.com/NTPsec/ntpsec/compare/e9e7205ffba934e339ecea41fadb75f2769084a5...39e8006e049bc9d913ff915edcd88f74587349bc
You're receiving this email because of your account on gitlab.com.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://lists.ntpsec.org/pipermail/vc/attachments/20170608/41ddd152/attachment.html>


More information about the vc mailing list