>Number:         157104
>Category:       misc
>Synopsis:       NTPD with -DDISABLE_IPV6 gives a lot of error messages, patch 
>attached
>Confidential:   no
>Severity:       non-critical
>Priority:       low
>Responsible:    freebsd-bugs
>State:          open
>Quarter:        
>Keywords:       
>Date-Required:
>Class:          sw-bug
>Submitter-Id:   current-users
>Arrival-Date:   Tue May 17 07:30:09 UTC 2011
>Closed-Date:
>Last-Modified:
>Originator:     Daniel Fahlgren
>Release:        8.2
>Organization:
Tutus Data
>Environment:
>Description:
If you build NTPD without IPv6 by adding the flag -DDISABLE_IPV6 to the 
makefile will you get a lot of errors during run time. The errors is that it 
failes to bind 0.0.0.0#123, and that message was repeated for all interfaces.
>How-To-Repeat:
Add -DDISABLE_IPV6 to the CFLAGS and rebuild ntpd. Run it on a machine with 
IPv6 enabled.
>Fix:
I didn't trace it down to exactly where that was done. But I found that line 
1218 -> 1233 in:

http://svnweb.freebsd.org/base/release/8.2.0/contrib/ntp/ntpd/ntp_io.c?view=markup

looks suspicious. The call to isc_net_probeipv6 is done regardless if we should 
have IPv6 or not. If ISC_PLATFORM_HAVEIPV6 is defined will also 
INCLUDE_IPV6_SUPPORT be defined according to line 60 so removing the second 
block seems like a correct solution. That solved my problem at least, Patch 
attached that applies to 8.2.0 cleanly. Patching head failed due to space 
changes after the if statements, but the same problem exists in the same place.

Patch attached with submission follows:

Index: ntp_io.c
===================================================================
--- ntp_io.c    (revision 222004)
+++ ntp_io.c    (working copy)
@@ -1217,27 +1217,20 @@
 
 #ifdef INCLUDE_IPV6_SUPPORT
        if (isc_net_probeipv6() == ISC_R_SUCCESS)
                scan_ipv6 = ISC_TRUE;
 #if defined(DEBUG)
        else
                if(debug)
                        netsyslog(LOG_ERR, "no IPv6 interfaces found");
 #endif
 #endif
-       if (isc_net_probeipv6() == ISC_R_SUCCESS)
-               scan_ipv6 = ISC_TRUE;
-#if defined(ISC_PLATFORM_HAVEIPV6) && defined(DEBUG)
-       else
-               if(debug)
-                       netsyslog(LOG_ERR, "no IPv6 interfaces found");
-#endif
 
        if (isc_net_probeipv4() == ISC_R_SUCCESS)
                scan_ipv4 = ISC_TRUE;
 #ifdef DEBUG
        else
                if(debug)
                        netsyslog(LOG_ERR, "no IPv4 interfaces found");
 #endif
        /*
         * phase one - scan interfaces


>Release-Note:
>Audit-Trail:
>Unformatted:
_______________________________________________
[email protected] mailing list
http://lists.freebsd.org/mailman/listinfo/freebsd-bugs
To unsubscribe, send any mail to "[email protected]"

Reply via email to