]> git.ipfire.org Git - thirdparty/ntp.git/commitdiff
[Bug 3781] log "Unable to listen for broadcasts" for IPv4
authorDave Hart <hart@ntp.org>
Mon, 27 Feb 2023 08:04:43 +0000 (03:04 -0500)
committerDave Hart <hart@ntp.org>
Mon, 27 Feb 2023 08:04:43 +0000 (03:04 -0500)
bk: 63fc641b7Eqc24lB2OE_VnaHS6wp5g

ChangeLog
ntpd/ntp_io.c

index 5d076c62c53d1d7bd763a96e6372d1787d24fd9f..95138c66da5b1edb96ceb1960a0b84b37e418962 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,4 +1,5 @@
 ---
+* [Bug 3781] log "Unable to listen for broadcasts" for IPv4 <hart@ntp.org>
 * [Bug 3595] pollskewlist documentation uses | when it shouldn't.
   - ntp.conf manual page and miscopt.html corrections. <hart@ntp.org>
 * [Bug 3797] Windows getaddrinfo w/AI_ADDRCONFIG fails for localhost when 
index 077a5a89f2d06a85eca5e9a71b2074f06aeba9b1..65fb0ad46bd6660e1f94c78634bd1a4a23f3e12d 100644 (file)
@@ -2604,19 +2604,17 @@ io_setbclient(void)
 {
 #ifdef OPEN_BCAST_SOCKET
        endpt *         ep;
-       unsigned int    nif, ni4, ni6;
+       unsigned int    nif, ni4;
 
-       nif = ni4 = ni6 = 0;
+       nif = ni4 = 0;
        set_reuseaddr(1);
 
        for (ep = ep_list; ep != NULL; ep = ep->elink) {
-               /* count IPv6 vs IPv4 interfaces. Needed later to decide
+               /* count IPv4 interfaces. Needed later to decide
                 * if we should log an error or not.
                 */
-               switch (ep->family) {
-               case AF_INET : ++ni4; break;
-               case AF_INET6: ++ni6; break;
-               default      :        break;
+               if (AF_INET == ep->family) {
+                       ++ni4;
                }
                
                if (ep->flags & (INT_WILDCARD | INT_LOOPBACK))
@@ -2696,7 +2694,7 @@ io_setbclient(void)
                 * and no IPv4 interfaces at all. We suppress the error
                 * log in that case... everything else should work!
                 */
-               if (ni4 && !ni6) {
+               if (ni4) {
                        msyslog(LOG_ERR,
                                "Unable to listen for broadcasts, no broadcast interfaces available");
                }