Implement dynamic interface discovery on *BSD
diff --git a/src/network.c b/src/network.c
index 3a6cad2..fd49b5c 100644
--- a/src/network.c
+++ b/src/network.c
@@ -489,7 +489,7 @@
addr.in6.sin6_scope_id = if_index;
else
addr.in6.sin6_scope_id = 0;
-
+
return iface_allowed((struct iface_param *)vparam, if_index, NULL, &addr, netmask, prefix, !!(flags & IFACE_TENTATIVE));
}
#endif
@@ -681,7 +681,7 @@
close (fd);
errno = errsav;
-
+
if (dienow)
{
/* failure to bind addresses given by --listen-address at this point
@@ -1470,7 +1470,31 @@
return gotone;
}
+#if defined(HAVE_LINUX_NETWORK) || defined(HAVE_BSD_NETWORK)
+/* Called when addresses are added or deleted from an interface */
+void newaddress(time_t now)
+{
+ (void)now;
+
+ if (option_bool(OPT_CLEVERBIND) || daemon->doing_dhcp6 || daemon->relay6 || daemon->doing_ra)
+ enumerate_interfaces(0);
+
+ if (option_bool(OPT_CLEVERBIND))
+ create_bound_listeners(0);
+
+#ifdef HAVE_DHCP6
+ if (daemon->doing_dhcp6 || daemon->relay6 || daemon->doing_ra)
+ join_multicast(0);
+
+ if (daemon->doing_dhcp6 || daemon->doing_ra)
+ dhcp_construct_contexts(now);
+
+ if (daemon->doing_dhcp6)
+ lease_find_interfaces(now);
+#endif
+}
+#endif