]> git.ipfire.org Git - thirdparty/ntp.git/commitdiff
[Bug 2792] If the IFF_RUNNING interface flag is supported then an interface is ignored
authorMartin Burnicki <burnicki@ntp.org>
Fri, 8 May 2015 10:25:43 +0000 (12:25 +0200)
committerMartin Burnicki <burnicki@ntp.org>
Fri, 8 May 2015 10:25:43 +0000 (12:25 +0200)
as long as this flag is not set since the interface is not usable (e.g., no link).

bk: 554c8f27omN7jQQR-gNskWbahvfroA

ChangeLog
lib/isc/unix/ifiter_getifaddrs.c

index 88bf769a78126619a5f1bc8cf930a861f13b14f5..3bdc0b0df84e4de5dff24bb4660461f40e4b56a2 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,5 +1,8 @@
 ---
 
+* [Bug 2792] If the IFF_RUNNING interface flag is supported then an interface
+  is ignored as long as this flag is not set since the interface is not usable
+  (e.g., no link).
 * CID 739725: Fix a rare resource leak in libevent/listener.c.
 * CID 1295478: Quiet a pedantic potential error from the fix for Bug 2776.
 * CID 1296235: Fix refclock_jjy.c and correcting type of the driver40-ja.html
index 425b9b4c3d3555476af039a1013e58696d79c326..b5b48618ff7ace0a0496e69302e2800505e9a32a 100644 (file)
@@ -147,6 +147,13 @@ internal_current(isc_interfaceiter_t *iter) {
        ifa = iter->pos;
 
 #ifdef __linux
+       /*
+        * burnicki: iter->pos is usually never NULL here (anymore?),
+        * so linux_if_inet6_current(iter) is never called here.
+        * However, that routine would check (under Linux), if the
+        * interface is in a tentative state, e.g. if there's no link
+        * yet but an IPv6 address has already be assigned.
+        */
        if (iter->pos == NULL)
                return (linux_if_inet6_current(iter));
 #endif
@@ -154,6 +161,16 @@ internal_current(isc_interfaceiter_t *iter) {
        INSIST(ifa != NULL);
        INSIST(ifa->ifa_name != NULL);
 
+
+#ifdef IFF_RUNNING
+       /*
+        * burnicki: if the interface is not running then
+        * it may be in a tentative state. See above.
+        */
+       if ((ifa->ifa_flags & IFF_RUNNING) == 0)
+               return (ISC_R_IGNORE);
+#endif
+
        if (ifa->ifa_addr == NULL)
                return (ISC_R_IGNORE);