]> git.ipfire.org Git - thirdparty/ntp.git/commitdiff
[Bug 637] Ignore UP in*addr_any interfaces
authorHarlan Stenn <stenn@ntp.org>
Sat, 17 Jun 2006 17:53:20 +0000 (13:53 -0400)
committerHarlan Stenn <stenn@ntp.org>
Sat, 17 Jun 2006 17:53:20 +0000 (13:53 -0400)
bk: 449441906zi0K0FTfTje8Xalyfas_Q

ntpd/ntp_io.c

index e630355269c82e49c3938891c34671f225a62b76..462f42f6fa46971cb723852920c6c872e5563115 100644 (file)
@@ -686,6 +686,21 @@ create_sockets(
                        inter_list[idx].ignore_packets = ISC_TRUE;
                }
                convert_isc_if(&isc_if, &inter_list[idx], port);
+
+               /*
+                * skip any interfaces UP and bound to a wildcard
+                * address - some dhcp clients produce that in the
+                * wild
+                */
+               if (family == AF_INET &&
+                   ((struct sockaddr_in*)&inter_list[idx].sin)->sin_addr.s_addr == htonl(INADDR_ANY))
+                       continue;
+
+               if (family == AF_INET6 &&
+                   memcmp(&((struct sockaddr_in6*)&inter_list[idx].sin)->sin6_addr, &in6addr_any,
+                          sizeof(in6addr_any) == 0))
+                       continue;
+
                inter_list[idx].fd = INVALID_SOCKET;
                inter_list[idx].bfd = INVALID_SOCKET;
                inter_list[idx].num_mcast = 0;