# HG changeset patch # User Brian Utterback # Date 1405434042 25200 # Node ID 3ac44c0bacae24868a11530b4757a5cdd6e5c0ce # Parent 73ff78fac05bc32ebe5ec4c1a472e663bd91a504 18526836 ntpd complains about invalid argument for IPv6 interface diff -r 73ff78fac05b -r 3ac44c0bacae components/ntp/patches/80-ipv6-einval.patch --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/components/ntp/patches/80-ipv6-einval.patch Tue Jul 15 07:20:42 2014 -0700 @@ -0,0 +1,71 @@ +This patch inserts if_nametoindex calls in each of the internal ISC +routines that lookup the interface attributes. Neither getifaddrs or +the existing ioctl calls lookup the index for the interface. + +This has been submitted as a patch for NTP bug 1960, and it can be +removed when NTP is upgraded to version that includes a fix for +1960. + +--- lib/isc/unix/ifiter_getifaddrs.c ++++ lib/isc/unix/ifiter_getifaddrs.c +@@ -204,6 +204,9 @@ internal_current(isc_interfaceiter_t *it + get_addr(family, &iter->current.broadcast, ifa->ifa_broadaddr, + ifa->ifa_name); + ++#ifdef ISC_PLATFORM_HAVEIFNAMETOINDEX ++ iter->current.ifindex = if_nametoindex(iter->current.name); ++#endif + return (ISC_R_SUCCESS); + } + +--- lib/isc/unix/ifiter_ioctl.c ++++ lib/isc/unix/ifiter_ioctl.c +@@ -588,6 +588,9 @@ internal_current4(isc_interfaceiter_t *i + } + iter->current.netmask.type.in6.s6_addr[i] = (~0 << bits) & 0xff; + } ++#ifdef ISC_PLATFORM_HAVEIFNAMETOINDEX ++ iter->current.ifindex = if_nametoindex(iter->current.name); ++#endif + return (ISC_R_SUCCESS); + + inet: +@@ -664,6 +667,9 @@ internal_current4(isc_interfaceiter_t *i + } + get_addr(family, &iter->current.netmask, + (struct sockaddr *)&ifreq.ifr_addr, ifreq.ifr_name); ++#ifdef ISC_PLATFORM_HAVEIFNAMETOINDEX ++ iter->current.ifindex = if_nametoindex(iter->current.name); ++#endif + return (ISC_R_SUCCESS); + } + +@@ -704,7 +710,6 @@ internal_current6(isc_interfaceiter_t *i + get_addr(family, &iter->current.address, + (struct sockaddr *)&lifreq.lifr_addr, lifreq.lifr_name); + +- iter->current.ifindex = lifreq.lifr_index; + if (isc_netaddr_islinklocal(&iter->current.address)) + isc_netaddr_setzone(&iter->current.address, + (isc_uint32_t)lifreq.lifr_index); +@@ -844,7 +849,9 @@ internal_current6(isc_interfaceiter_t *i + iter->current.netmask.type.in6.s6_addr[i / 8] = + (~0 << bits) & 0xff; + } +- ++#ifdef ISC_PLATFORM_HAVEIFNAMETOINDEX ++ iter->current.ifindex = if_nametoindex(iter->current.name); ++#endif + return (ISC_R_SUCCESS); + } + #endif +@@ -867,6 +874,9 @@ internal_current6(isc_interfaceiter_t *i + get_addr(family, &iter->current.netmask, + (struct sockaddr *)&lifreq.lifr_addr, lifreq.lifr_name); + ++#ifdef ISC_PLATFORM_HAVEIFNAMETOINDEX ++ iter->current.ifindex = if_nametoindex(iter->current.name); ++#endif + return (ISC_R_SUCCESS); + } + #endif