diff options
author | jinmei <jinmei@FreeBSD.org> | 2007-05-25 06:44:00 +0000 |
---|---|---|
committer | jinmei <jinmei@FreeBSD.org> | 2007-05-25 06:44:00 +0000 |
commit | b780a97c819314fb7693d73ab6abeaace981fc35 (patch) | |
tree | ad6c36796fb6070072e1460110f67317c24775da /sys/netinet6/in6.c | |
parent | aa5ff5bd9845d83800faf71692af8bd67e36aa0a (diff) | |
download | FreeBSD-src-b780a97c819314fb7693d73ab6abeaace981fc35.zip FreeBSD-src-b780a97c819314fb7693d73ab6abeaace981fc35.tar.gz |
do not directly call rtfree() to meet an assumption in the callee.
(this fix suppresses a warning message appearing in the boot time on
IPv6-enabled systems)
Approved by: gnn (mentor)
Diffstat (limited to 'sys/netinet6/in6.c')
-rw-r--r-- | sys/netinet6/in6.c | 15 |
1 files changed, 9 insertions, 6 deletions
diff --git a/sys/netinet6/in6.c b/sys/netinet6/in6.c index 6aa0f9c..81ef6fb 100644 --- a/sys/netinet6/in6.c +++ b/sys/netinet6/in6.c @@ -188,9 +188,9 @@ in6_ifloop_request(int cmd, struct ifaddr *ifa) } rt_newaddrmsg(cmd, ifa, e, nrt); - if (cmd == RTM_DELETE) { - rtfree(nrt); - } else { + if (cmd == RTM_DELETE) + RTFREE_LOCKED(nrt); + else { /* the cmd must be RTM_ADD here */ RT_REMREF(nrt); RT_UNLOCK(nrt); @@ -215,8 +215,10 @@ in6_ifaddloop(struct ifaddr *ifa) rt = rtalloc1(ifa->ifa_addr, 0, 0); need_loop = (rt == NULL || (rt->rt_flags & RTF_HOST) == 0 || (rt->rt_ifp->if_flags & IFF_LOOPBACK) == 0); - if (rt) - rtfree(rt); + if (rt) { + RT_REMREF(rt); + RT_UNLOCK(rt); + } if (need_loop) in6_ifloop_request(RTM_ADD, ifa); } @@ -268,7 +270,8 @@ in6_ifremloop(struct ifaddr *ifa) if (rt != NULL) { if ((rt->rt_flags & RTF_HOST) != 0 && (rt->rt_ifp->if_flags & IFF_LOOPBACK) != 0) { - rtfree(rt); + RT_REMREF(rt); + RT_UNLOCK(rt); in6_ifloop_request(RTM_DELETE, ifa); } else RT_UNLOCK(rt); |