summaryrefslogtreecommitdiffstats
path: root/freebsd/sys/netinet6/in6_ifattach.c
diff options
context:
space:
mode:
authorSebastian Huber <sebastian.huber@embedded-brains.de>2016-12-09 14:19:03 +0100
committerSebastian Huber <sebastian.huber@embedded-brains.de>2017-01-10 09:53:34 +0100
commit75b706fde4cbf82bcd41a1cec319778aa0f8eb2d (patch)
treeea39a351a1f6337b5a5dd6036314693adef5ffe6 /freebsd/sys/netinet6/in6_ifattach.c
parentVMSTAT(8): Port to RTEMS (diff)
downloadrtems-libbsd-75b706fde4cbf82bcd41a1cec319778aa0f8eb2d.tar.bz2
Update to FreeBSD head 2016-12-10
Git mirror commit 80c55f08a05ab3b26a73b226ccb56adc3122a55c.
Diffstat (limited to 'freebsd/sys/netinet6/in6_ifattach.c')
-rw-r--r--freebsd/sys/netinet6/in6_ifattach.c25
1 files changed, 8 insertions, 17 deletions
diff --git a/freebsd/sys/netinet6/in6_ifattach.c b/freebsd/sys/netinet6/in6_ifattach.c
index 791e9e27..879336a4 100644
--- a/freebsd/sys/netinet6/in6_ifattach.c
+++ b/freebsd/sys/netinet6/in6_ifattach.c
@@ -459,6 +459,7 @@ in6_ifattach_linklocal(struct ifnet *ifp, struct ifnet *altifp)
struct in6_ifaddr *ia;
struct in6_aliasreq ifra;
struct nd_prefixctl pr0;
+ struct nd_prefix *pr;
int error;
/*
@@ -541,10 +542,11 @@ in6_ifattach_linklocal(struct ifnet *ifp, struct ifnet *altifp)
* address, and then reconfigure another one, the prefix is still
* valid with referring to the old link-local address.
*/
- if (nd6_prefix_lookup(&pr0) == NULL) {
+ if ((pr = nd6_prefix_lookup(&pr0)) == NULL) {
if ((error = nd6_prelist_add(&pr0, NULL, NULL)) != 0)
return (error);
- }
+ } else
+ nd6_prefix_rele(pr);
return 0;
}
@@ -788,15 +790,6 @@ _in6_ifdetach(struct ifnet *ifp, int purgeulp)
return;
/*
- * Remove neighbor management table.
- * Enabling the nd6_purge will panic on vmove for interfaces on VNET
- * teardown as the IPv6 layer is cleaned up already and the locks
- * are destroyed.
- */
- if (purgeulp)
- nd6_purge(ifp);
-
- /*
* nuke any of IPv6 addresses we have
* XXX: all addresses should be already removed
*/
@@ -814,12 +807,10 @@ _in6_ifdetach(struct ifnet *ifp, int purgeulp)
in6_purgemaddrs(ifp);
/*
- * remove neighbor management table. we call it twice just to make
- * sure we nuke everything. maybe we need just one call.
- * XXX: since the first call did not release addresses, some prefixes
- * might remain. We should call nd6_purge() again to release the
- * prefixes after removing all addresses above.
- * (Or can we just delay calling nd6_purge until at this point?)
+ * Remove neighbor management table.
+ * Enabling the nd6_purge will panic on vmove for interfaces on VNET
+ * teardown as the IPv6 layer is cleaned up already and the locks
+ * are destroyed.
*/
if (purgeulp)
nd6_purge(ifp);