From owner-freebsd-net@FreeBSD.ORG Thu Jan 8 17:29:26 2015 Return-Path: Delivered-To: freebsd-net@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 16AA4349 for ; Thu, 8 Jan 2015 17:29:26 +0000 (UTC) Received: from mail.mahoroba.org (ent.mahoroba.org [IPv6:2001:2f0:104:8010::1]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "asuka.mahoroba.org", Issuer "ca.mahoroba.org" (not verified)) by mx1.freebsd.org (Postfix) with ESMTPS id C3D4DCF5 for ; Thu, 8 Jan 2015 17:29:25 +0000 (UTC) Received: from yuga.mahoroba.org (ume@yuga.mahoroba.org [IPv6:2001:2f0:104:8010:7258:12ff:fe22:d94b]) (user=ume mech=DIGEST-MD5 bits=0) by mail.mahoroba.org (8.14.9/8.14.9) with ESMTP/inet6 id t08HSvuT051333 (version=TLSv1/SSLv3 cipher=AES128-GCM-SHA256 bits=128 verify=NO); Fri, 9 Jan 2015 02:29:02 +0900 (JST) (envelope-from ume@mahoroba.org) Date: Fri, 09 Jan 2015 02:28:56 +0900 Message-ID: From: Hajimu UMEMOTO To: hiren panchasara Subject: Re: ntpd bind() failure: Can't assign requested address In-Reply-To: References: <1364308780.51602.YahooMailClassic@web31809.mail.mud.yahoo.com> <02416974-D249-4432-9CE6-6093CA9FCCD7@netapp.com> User-Agent: xcite1.60> Wanderlust/2.15.9 (Almost Unreal) Emacs/24.4 Mule/6.0 (HANACHIRUSATO) X-Operating-System: FreeBSD 10.1-STABLE X-PGP-Key: http://www.mahoroba.org/~ume/publickey.asc X-PGP-Fingerprint: 1F00 0B9E 2164 70FC 6DC5 BF5F 04E9 F086 BF90 71FE MIME-Version: 1.0 (generated by SEMI 1.14.6 - "Maruoka") Content-Type: multipart/mixed; boundary="Multipart_Fri_Jan__9_02:28:55_2015-1" X-Greylist: Sender succeeded SMTP AUTH, not delayed by milter-greylist-4.4.3 (mail.mahoroba.org [IPv6:2001:2f0:104:8010::1]); Fri, 09 Jan 2015 02:29:05 +0900 (JST) X-Virus-Scanned: clamav-milter 0.98.5 at asuka.mahoroba.org X-Virus-Status: Clean X-Spam-Status: No, score=-2.9 required=5.0 tests=ALL_TRUSTED,BAYES_00, HEADER_FROM_DIFFERENT_DOMAINS,T_RP_MATCHES_RCVD autolearn=ham autolearn_force=no version=3.4.0 X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on asuka.mahoroba.org Cc: "" , "Eggert, Lars" , "schrodinger@konundrum.org" , "freebsd-net@freebsd.org" X-BeenThere: freebsd-net@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: Networking and TCP/IP with FreeBSD List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 08 Jan 2015 17:29:26 -0000 --Multipart_Fri_Jan__9_02:28:55_2015-1 Content-Type: text/plain; charset=US-ASCII Hi, >>>>> On Wed, 7 Jan 2015 16:56:58 -0800 >>>>> hiren panchasara said: hiren> I see this message on july 2014 time-frame -CURRENT. I tried to hiren> disable IPv6 in rc.conf via ipv6_activate_all_interfaces="NO" without hiren> success. hiren> Has this been fixed? Or any workarounds? Perhaps, your interface has an IPv6 link-local address which is tentative state. Please try the attached patch. This patch ignores a tentative address. Sincerely, --Multipart_Fri_Jan__9_02:28:55_2015-1 Content-Type: text/x-patch; type=patch; charset=US-ASCII Content-Disposition: attachment; filename="ntp_io.c-tentative.diff" Content-Transfer-Encoding: 7bit Index: contrib/ntp/ntpd/ntp_io.c =================================================================== --- contrib/ntp/ntpd/ntp_io.c (revision 276829) +++ contrib/ntp/ntpd/ntp_io.c (working copy) @@ -1176,12 +1176,13 @@ #ifdef INCLUDE_IPV6_SUPPORT static isc_boolean_t -is_anycast(struct sockaddr *sa, char *name) +is_not_bindable(struct sockaddr *sa, char *name) { -#if defined(SIOCGIFAFLAG_IN6) && defined(IN6_IFF_ANYCAST) +#if defined(SIOCGIFAFLAG_IN6) && \ + (defined(IN6_IFF_ANYCAST) || defined(IN6_IFF_NOTREADY)) struct in6_ifreq ifr6; int fd; - u_int32_t flags6; + u_int32_t flags6, exclude = 0; if (sa->sa_family != AF_INET6) return ISC_FALSE; @@ -1197,9 +1198,15 @@ } close(fd); flags6 = ifr6.ifr_ifru.ifru_flags6; - if ((flags6 & IN6_IFF_ANYCAST) != 0) +#if defined(IN6_IFF_ANYCAST) + exclude |= IN6_IFF_ANYCAST; +#endif +#if defined(IN6_IFF_NOTREADY) + exclude |= IN6_IFF_NOTREADY; +#endif + if ((flags6 & exclude) != 0) return ISC_TRUE; -#endif /* !SIOCGIFAFLAG_IN6 || !IN6_IFF_ANYCAST */ +#endif /* !SIOCGIFAFLAG_IN6 || !(IN6_IFF_ANYCAST && IN6_IFF_NOTREADY) */ return ISC_FALSE; } #endif /* !INCLUDE_IPV6_SUPPORT */ @@ -1344,7 +1351,7 @@ continue; #ifdef INCLUDE_IPV6_SUPPORT - if (is_anycast((struct sockaddr *)&interface.sin, isc_if.name)) + if (is_not_bindable((struct sockaddr *)&interface.sin, isc_if.name)) continue; #endif /* !INCLUDE_IPV6_SUPPORT */ --Multipart_Fri_Jan__9_02:28:55_2015-1 Content-Type: text/plain; charset=US-ASCII -- Hajimu UMEMOTO ume@mahoroba.org ume@{,jp.}FreeBSD.org http://www.mahoroba.org/~ume/ --Multipart_Fri_Jan__9_02:28:55_2015-1--