diff options
Diffstat (limited to 'sys/netinet6/nd6.c')
| -rw-r--r-- | sys/netinet6/nd6.c | 18 |
1 files changed, 15 insertions, 3 deletions
diff --git a/sys/netinet6/nd6.c b/sys/netinet6/nd6.c index 2ca862a2a62..4d29da3994b 100644 --- a/sys/netinet6/nd6.c +++ b/sys/netinet6/nd6.c @@ -1,4 +1,4 @@ -/* $NetBSD: nd6.c,v 1.155 2014/12/03 01:32:11 christos Exp $ */ +/* $NetBSD: nd6.c,v 1.156 2014/12/16 11:42:27 roy Exp $ */ /* $KAME: nd6.c,v 1.279 2002/06/08 11:16:51 itojun Exp $ */ /* @@ -31,7 +31,7 @@ */ #include <sys/cdefs.h> -__KERNEL_RCSID(0, "$NetBSD: nd6.c,v 1.155 2014/12/03 01:32:11 christos Exp $"); +__KERNEL_RCSID(0, "$NetBSD: nd6.c,v 1.156 2014/12/16 11:42:27 roy Exp $"); #include "bridge.h" #include "carp.h" @@ -1037,6 +1037,7 @@ nd6_free(struct rtentry *rt, int gc) struct llinfo_nd6 *ln = (struct llinfo_nd6 *)rt->rt_llinfo, *next; struct in6_addr in6 = satocsin6(rt_getkey(rt))->sin6_addr; struct nd_defrouter *dr; + struct rtentry *oldrt; /* * we used to have pfctlinput(PRC_HOSTDEAD) here. @@ -1129,7 +1130,15 @@ nd6_free(struct rtentry *rt, int gc) * caches, and disable the route entry not to be used in already * cached routes. */ - rtrequest(RTM_DELETE, rt_getkey(rt), NULL, rt_mask(rt), 0, NULL); + oldrt = NULL; + rtrequest(RTM_DELETE, rt_getkey(rt), NULL, rt_mask(rt), 0, &oldrt); + if (oldrt) { + nd6_rtmsg(RTM_DELETE, oldrt); /* tell user process */ + if (oldrt->rt_refcnt <= 0) { + oldrt->rt_refcnt++; + rtfree(oldrt); + } + } return next; } @@ -2059,6 +2068,9 @@ fail: break; } + if (do_update) + nd6_rtmsg(RTM_CHANGE, rt); /* tell user process */ + /* * When the link-layer address of a router changes, select the * best router again. In particular, when the neighbor entry is newly |
