aboutsummaryrefslogtreecommitdiff
path: root/lib/isc/unix/ifiter_getifaddrs.c
diff options
context:
space:
mode:
Diffstat (limited to 'lib/isc/unix/ifiter_getifaddrs.c')
-rw-r--r--lib/isc/unix/ifiter_getifaddrs.c19
1 files changed, 19 insertions, 0 deletions
diff --git a/lib/isc/unix/ifiter_getifaddrs.c b/lib/isc/unix/ifiter_getifaddrs.c
index 425b9b4c3d35..ad7c5f85c8ec 100644
--- a/lib/isc/unix/ifiter_getifaddrs.c
+++ b/lib/isc/unix/ifiter_getifaddrs.c
@@ -147,6 +147,14 @@ internal_current(isc_interfaceiter_t *iter) {
ifa = iter->pos;
#ifdef __linux
+ /*
+ * [Bug 2792]
+ * burnicki: iter->pos is usually never NULL here (anymore?),
+ * so linux_if_inet6_current(iter) is never called here.
+ * However, that routine would check (under Linux), if the
+ * interface is in a tentative state, e.g. if there's no link
+ * yet but an IPv6 address has already be assigned.
+ */
if (iter->pos == NULL)
return (linux_if_inet6_current(iter));
#endif
@@ -154,6 +162,17 @@ internal_current(isc_interfaceiter_t *iter) {
INSIST(ifa != NULL);
INSIST(ifa->ifa_name != NULL);
+
+#ifdef IFF_RUNNING
+ /*
+ * [Bug 2792]
+ * burnicki: if the interface is not running then
+ * it may be in a tentative state. See above.
+ */
+ if ((ifa->ifa_flags & IFF_RUNNING) == 0)
+ return (ISC_R_IGNORE);
+#endif
+
if (ifa->ifa_addr == NULL)
return (ISC_R_IGNORE);