misc/95550: NTPD/ntpdate complain about IPv6 interface not found

Ricky Y. Sun sunyuxi at yahoo.com
Sun Apr 9 18:30:30 UTC 2006


>Number:         95550
>Category:       misc
>Synopsis:       NTPD/ntpdate complain about IPv6 interface not found
>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:   Sun Apr 09 18:30:19 GMT 2006
>Closed-Date:
>Last-Modified:
>Originator:     Ricky Y. Sun
>Release:        FreeBSD6.x
>Organization:
>Environment:
FreeBSD 945gd.pewr.com 6.1-PRERELEASE FreeBSD 6.1-PRERELEASE #1: Fri Mar 17 08:59:43 PST 2006     root at 945gd.pewr.com:/usr/obj/usr/src/sys/PEWR6_P4  i386
>Description:


ntpdate (or ntpd -q) will complain that IPv6 interface not found, if INET6 is disabled during kernel rebuilding.


This turns out to be the deficiency in contrib/ntp/ntpd/ntp_io.c source code:


The following code patch should be, or strongly recommended to be, checked in accordingly:


--- contrib/ntp/ntpd/ntp_io.c.orig    
+++ contrib/ntp/ntpd/ntp_io.c   
@@ -429,15 +429,23 @@
/*--------------------- BEGIN of PATCH ------------------------ */
        if (isc_net_probeipv6() == ISC_R_SUCCESS)
                scan_ipv6 = ISC_TRUE;
-#ifdef HAVE_IPV6
+#if defined(HAVE_IPV6) && defined(DEBUG)
        else
-               netsyslog(LOG_ERR, "no IPv6 interfaces found");
+       {
+               if (debug)
+                       netsyslog(LOG_ERR, "no IPv6 interfaces found");
+       }
 #endif

        if (isc_net_probeipv4() == ISC_R_SUCCESS)
                scan_ipv4 = ISC_TRUE;
+#ifdef DEBUG
        else
-               netsyslog(LOG_ERR, "no IPv4 interfaces found");
+       {
+               if (debug)
+                       netsyslog(LOG_ERR, "no IPv4 interfaces found");
+       }
+#endif

        nwilds = create_wildcards(port);
        idx = nwilds; 
/*--------------------- END of PATCH ------------------------ */




>How-To-Repeat:

If your FreeBSD 5.x/6.x kernel has no IPv6 (a.k.a. INET6) option built-in,

either you start ntpd via /etc/rc.conf or invoke it from CLI...

it complains about: " IPv6 interface not found .... ", similar complain if you have only IPv6 interface built in ;-)
>Fix:
Manually Patched: /usr/src/contrib/ntp/ntpd/ntp_io.c
ntp_io.c.orig is the original file which isn't changed ever since 7/20/2004

--- contrib/ntp/ntpd/ntp_io.c.orig    
+++ contrib/ntp/ntpd/ntp_io.c   
@@ -429,15 +429,23 @@
/*--------------------- BEGIN of PATCH ------------------------ */
        if (isc_net_probeipv6() == ISC_R_SUCCESS)
                scan_ipv6 = ISC_TRUE;
-#ifdef HAVE_IPV6
+#if defined(HAVE_IPV6) && defined(DEBUG)
        else
-               netsyslog(LOG_ERR, "no IPv6 interfaces found");
+       {
+               if (debug)
+                       netsyslog(LOG_ERR, "no IPv6 interfaces found");
+       }
 #endif

        if (isc_net_probeipv4() == ISC_R_SUCCESS)
                scan_ipv4 = ISC_TRUE;
+#ifdef DEBUG
        else
-               netsyslog(LOG_ERR, "no IPv4 interfaces found");
+       {
+               if (debug)
+                       netsyslog(LOG_ERR, "no IPv4 interfaces found");
+       }
+#endif

        nwilds = create_wildcards(port);
        idx = nwilds; 
/*--------------------- END of PATCH ------------------------ */




>Release-Note:
>Audit-Trail:
>Unformatted:


More information about the freebsd-bugs mailing list