From owner-freebsd-bugs@FreeBSD.ORG Tue May 17 07:30:10 2011 Return-Path: Delivered-To: freebsd-bugs@hub.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 94377106566B for ; Tue, 17 May 2011 07:30:10 +0000 (UTC) (envelope-from gnats@FreeBSD.org) Received: from freefall.freebsd.org (freefall.freebsd.org [IPv6:2001:4f8:fff6::28]) by mx1.freebsd.org (Postfix) with ESMTP id 6652C8FC1A for ; Tue, 17 May 2011 07:30:10 +0000 (UTC) Received: from freefall.freebsd.org (localhost [127.0.0.1]) by freefall.freebsd.org (8.14.4/8.14.4) with ESMTP id p4H7UAw6013486 for ; Tue, 17 May 2011 07:30:10 GMT (envelope-from gnats@freefall.freebsd.org) Received: (from gnats@localhost) by freefall.freebsd.org (8.14.4/8.14.4/Submit) id p4H7UApW013484; Tue, 17 May 2011 07:30:10 GMT (envelope-from gnats) Resent-Date: Tue, 17 May 2011 07:30:10 GMT Resent-Message-Id: <201105170730.p4H7UApW013484@freefall.freebsd.org> Resent-From: FreeBSD-gnats-submit@FreeBSD.org (GNATS Filer) Resent-To: freebsd-bugs@FreeBSD.org Resent-Reply-To: FreeBSD-gnats-submit@FreeBSD.org, Daniel Fahlgren Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id EABB1106566C for ; Tue, 17 May 2011 07:22:11 +0000 (UTC) (envelope-from nobody@FreeBSD.org) Received: from red.freebsd.org (red.freebsd.org [IPv6:2001:4f8:fff6::22]) by mx1.freebsd.org (Postfix) with ESMTP id BF50A8FC14 for ; Tue, 17 May 2011 07:22:11 +0000 (UTC) Received: from red.freebsd.org (localhost [127.0.0.1]) by red.freebsd.org (8.14.4/8.14.4) with ESMTP id p4H7MBX0040743 for ; Tue, 17 May 2011 07:22:11 GMT (envelope-from nobody@red.freebsd.org) Received: (from nobody@localhost) by red.freebsd.org (8.14.4/8.14.4/Submit) id p4H7MBLi040742; Tue, 17 May 2011 07:22:11 GMT (envelope-from nobody) Message-Id: <201105170722.p4H7MBLi040742@red.freebsd.org> Date: Tue, 17 May 2011 07:22:11 GMT From: Daniel Fahlgren To: freebsd-gnats-submit@FreeBSD.org X-Send-Pr-Version: www-3.1 Cc: Subject: misc/157104: NTPD with -DDISABLE_IPV6 gives a lot of error messages, patch attached X-BeenThere: freebsd-bugs@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Bug reports List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 17 May 2011 07:30:10 -0000 >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: