diff options
author | Martin Pieuchot <mpi@cvs.openbsd.org> | 2015-09-10 09:37:53 +0000 |
---|---|---|
committer | Martin Pieuchot <mpi@cvs.openbsd.org> | 2015-09-10 09:37:53 +0000 |
commit | 54912bc9a49da0adc22790583019b85b1114e6ec (patch) | |
tree | 6d050e42c32cac760a61478d533a7cc38a187d92 | |
parent | e95293dff0fab777f77a3397bf3561b1c83bdf15 (diff) |
Use rtfree(9) rather than decrementing the reference counter.
We know the parent wont be freed at this point because cloned
routes are always purged from the tree before parents.
ok claudio@
-rw-r--r-- | sys/net/route.c | 14 |
1 files changed, 5 insertions, 9 deletions
diff --git a/sys/net/route.c b/sys/net/route.c index 64e1df22c6d..5952ce74dc3 100644 --- a/sys/net/route.c +++ b/sys/net/route.c @@ -1,4 +1,4 @@ -/* $OpenBSD: route.c,v 1.230 2015/09/04 08:43:39 mpi Exp $ */ +/* $OpenBSD: route.c,v 1.231 2015/09/10 09:37:52 mpi Exp $ */ /* $NetBSD: route.c,v 1.14 1996/02/13 22:00:46 christos Exp $ */ /* @@ -830,15 +830,11 @@ rtrequest1(int req, struct rt_addrinfo *info, u_int8_t prio, if ((rt->rt_flags & RTF_CLONING) != 0) rtflushclone(tableid, rt); - if (rt->rt_gwroute) { - rtfree(rt->rt_gwroute); - rt->rt_gwroute = NULL; - } + rtfree(rt->rt_gwroute); + rt->rt_gwroute = NULL; - if (rt->rt_parent) { - rt->rt_parent->rt_refcnt--; - rt->rt_parent = NULL; - } + rtfree(rt->rt_parent); + rt->rt_parent = NULL; rt->rt_flags &= ~RTF_UP; if ((ifa = rt->rt_ifa) && ifa->ifa_rtrequest) |