aboutsummaryrefslogtreecommitdiff
path: root/sys/netinet6/nd6.c
diff options
context:
space:
mode:
authorBjoern A. Zeeb <bz@FreeBSD.org>2019-03-07 23:03:39 +0000
committerBjoern A. Zeeb <bz@FreeBSD.org>2019-03-07 23:03:39 +0000
commit30b450774e87134d6b9455e88019a1b52153b80c (patch)
tree14a7b84c2f002d3df8c7088ae870153543a67089 /sys/netinet6/nd6.c
parentede8782611af64451d65360371345224f9f7fdf3 (diff)
downloadsrc-30b450774e87134d6b9455e88019a1b52153b80c.tar.gz
src-30b450774e87134d6b9455e88019a1b52153b80c.zip
Update for IETF draft-ietf-6man-ipv6only-flag.
When we roam between networks and our link-state goes down, automatically remove the IPv6-Only flag from the interface. Otherwise we might switch from an IPv6-only to and IPv4-only network and the flag would stay and we would prevent IPv4 from working. While the actual function call to clear the flag is under EXPERIMENTAL, the eventhandler is not as we might want to re-use it for other functionality on link-down event (such was re-calculate default routers for example if there is more than one). Reviewed by: hrs Differential Revision: https://reviews.freebsd.org/D19487
Notes
Notes: svn path=/head/; revision=344904
Diffstat (limited to 'sys/netinet6/nd6.c')
-rw-r--r--sys/netinet6/nd6.c5
1 files changed, 4 insertions, 1 deletions
diff --git a/sys/netinet6/nd6.c b/sys/netinet6/nd6.c
index e9c4bb53b693..faab9f0adc8b 100644
--- a/sys/netinet6/nd6.c
+++ b/sys/netinet6/nd6.c
@@ -113,7 +113,7 @@ VNET_DEFINE(int, nd6_debug) = 1;
VNET_DEFINE(int, nd6_debug) = 0;
#endif
-static eventhandler_tag lle_event_eh, iflladdr_event_eh;
+static eventhandler_tag lle_event_eh, iflladdr_event_eh, ifnet_link_event_eh;
VNET_DEFINE(struct nd_drhead, nd_defrouter);
VNET_DEFINE(struct nd_prhead, nd_prefix);
@@ -233,6 +233,8 @@ nd6_init(void)
NULL, EVENTHANDLER_PRI_ANY);
iflladdr_event_eh = EVENTHANDLER_REGISTER(iflladdr_event,
nd6_iflladdr, NULL, EVENTHANDLER_PRI_ANY);
+ ifnet_link_event_eh = EVENTHANDLER_REGISTER(ifnet_link_event,
+ nd6_ifnet_link_event, NULL, EVENTHANDLER_PRI_ANY);
}
}
@@ -244,6 +246,7 @@ nd6_destroy()
callout_drain(&V_nd6_slowtimo_ch);
callout_drain(&V_nd6_timer_ch);
if (IS_DEFAULT_VNET(curvnet)) {
+ EVENTHANDLER_DEREGISTER(ifnet_link_event, ifnet_link_event_eh);
EVENTHANDLER_DEREGISTER(lle_event, lle_event_eh);
EVENTHANDLER_DEREGISTER(iflladdr_event, iflladdr_event_eh);
}