diff options
Diffstat (limited to 'sys/netinet6')
-rw-r--r-- | sys/netinet6/in6.c | 6 | ||||
-rw-r--r-- | sys/netinet6/nd6_rtr.c | 18 |
2 files changed, 4 insertions, 20 deletions
diff --git a/sys/netinet6/in6.c b/sys/netinet6/in6.c index c450dea..945ab65 100644 --- a/sys/netinet6/in6.c +++ b/sys/netinet6/in6.c @@ -197,11 +197,7 @@ in6_ifloop_request(int cmd, struct ifaddr *ifa) if (nrt) { rt_newaddrmsg(cmd, ifa, e, nrt); if (cmd == RTM_DELETE) { - if (nrt->rt_refcnt <= 0) { - /* XXX: we should free the entry ourselves. */ - nrt->rt_refcnt++; - rtfree(nrt); - } + RTFREE(nrt); } else { /* the cmd must be RTM_ADD here */ nrt->rt_refcnt--; diff --git a/sys/netinet6/nd6_rtr.c b/sys/netinet6/nd6_rtr.c index c920636..338a00c 100644 --- a/sys/netinet6/nd6_rtr.c +++ b/sys/netinet6/nd6_rtr.c @@ -574,14 +574,7 @@ defrouter_delreq(dr, dofree) RTF_GATEWAY, &oldrt); if (oldrt) { nd6_rtmsg(RTM_DELETE, oldrt); - if (oldrt->rt_refcnt <= 0) { - /* - * XXX: borrowed from the RTM_DELETE case of - * rtrequest(). - */ - oldrt->rt_refcnt++; - rtfree(oldrt); - } + RTFREE(oldrt); } if (dofree) /* XXX: necessary? */ @@ -1583,13 +1576,8 @@ nd6_prefix_offlink(pr) error)); } - if (rt != NULL) { - if (rt->rt_refcnt <= 0) { - /* XXX: we should free the entry ourselves. */ - rt->rt_refcnt++; - rtfree(rt); - } - } + if (rt != NULL) + RTFREE(rt); return(error); } |