NetBSD-Bugs archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

bin/45308: ntpd doens't listen to broadcast anymore

>Number:         45308
>Category:       bin
>Synopsis:       ntpd doens't listen to broadcast anymore
>Confidential:   no
>Severity:       serious
>Priority:       medium
>Responsible:    bin-bug-people
>State:          open
>Class:          sw-bug
>Submitter-Id:   net
>Arrival-Date:   Mon Aug 29 16:30:00 +0000 2011
>Release:        NetBSD 5.99.52
System: NetBSD 5.99.52 NetBSD 5.99.52 (XEN3_DOMU) #59: Mon Jun 
20 21:32:56 CEST 2011 
Architecture: x86_64
Machine: amd64
        I'm running ntpd with '-A -b' on most of my client systems;
        I have 2 servers broadcasting ntp packets on local nets.
        This works fine for netbsd-5 (and previous) hosts but I noticed
        this doesn't work with HEAD: ntpd logs
        Aug 29 18:04:08 comore ntpd[530]: Unable to listen for broadcasts, no 
broadcast interfaces available
        and no ntp packets are accepted.
        debug (ntpd -A -b -d -d) shows that this message shows up
        *before* ntpd has probed any interface, so indeed there's no
        broadcast interface because there's no interface at all at this time.
        Adding -I iface to the command line doesn't help.

        ntpd -A -b, notice ntpd doesn't sync although tcpdump shows incoming
        broadcast ntpd messages
        The patch below makes -b works as expected: after probing
        interfaces, call io_setbclient() again so it can work on a non-empty
        interface list.
        I've no idea if this is the right way of fixing this though ...

Index: ntpd/ntp_io.c
RCS file: /cvsroot/src/external/bsd/ntp/dist/ntpd/ntp_io.c,v
retrieving revision 1.5
diff -u -p -u -r1.5 ntp_io.c
--- ntpd/ntp_io.c       9 Jan 2011 14:49:40 -0000       1.5
+++ ntpd/ntp_io.c       29 Aug 2011 16:18:00 -0000
@@ -1782,6 +1782,9 @@ create_sockets(
        update_interfaces(port, NULL, NULL);
+       if (sys_bclient)
+               io_setbclient();
         * Now that we have opened all the sockets, turn off the reuse

        (also checked on up do date HEAD)

Home | Main Index | Thread Index | Old Index