Date: Fri, 09 Jan 2015 02:28:56 +0900 From: Hajimu UMEMOTO <ume@FreeBSD.org> To: hiren panchasara <hiren.panchasara@gmail.com> Cc: "<ktsin@acm.org>" <ktsin@acm.org>, "Eggert, Lars" <lars@netapp.com>, "schrodinger@konundrum.org" <schrodinger@konundrum.org>, "freebsd-net@freebsd.org" <freebsd-net@freebsd.org> Subject: Re: ntpd bind() failure: Can't assign requested address Message-ID: <yged26puqp3.wl%ume@FreeBSD.org> In-Reply-To: <CALCpEUGdO64%2BxU55vLSRq2swfAfOPDN6YxVGytS%2BnwaejTpsSg@mail.gmail.com> References: <1364308780.51602.YahooMailClassic@web31809.mail.mud.yahoo.com> <02416974-D249-4432-9CE6-6093CA9FCCD7@netapp.com> <CALCpEUGdO64%2BxU55vLSRq2swfAfOPDN6YxVGytS%2BnwaejTpsSg@mail.gmail.com>
next in thread | previous in thread | raw e-mail | index | archive | help
--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 <hiren.panchasara@gmail.com> 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--
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?yged26puqp3.wl%ume>
