diff options
author | Martin Pieuchot <mpi@cvs.openbsd.org> | 2015-10-22 17:19:39 +0000 |
---|---|---|
committer | Martin Pieuchot <mpi@cvs.openbsd.org> | 2015-10-22 17:19:39 +0000 |
commit | fc19a686339eb476057c8b3b989db339efea3f4c (patch) | |
tree | ba852253c2f461f23d56b3539c8669e49b403d63 /sys/net/rtable.c | |
parent | 2edfccc2dfab288140ad019eedf2f35b3bf81d2d (diff) |
Use only one refcounting mechanism for route entries.
ok bluhm@, dlg@, claudio@
Diffstat (limited to 'sys/net/rtable.c')
-rw-r--r-- | sys/net/rtable.c | 8 |
1 files changed, 6 insertions, 2 deletions
diff --git a/sys/net/rtable.c b/sys/net/rtable.c index ae13f2ff0a5..dfbdc6975bb 100644 --- a/sys/net/rtable.c +++ b/sys/net/rtable.c @@ -1,4 +1,4 @@ -/* $OpenBSD: rtable.c,v 1.13 2015/10/21 08:47:01 mpi Exp $ */ +/* $OpenBSD: rtable.c,v 1.14 2015/10/22 17:19:38 mpi Exp $ */ /* * Copyright (c) 2014-2015 Martin Pieuchot @@ -329,6 +329,9 @@ rtable_delete(unsigned int rtableid, struct sockaddr *dst, if (rn->rn_flags & (RNF_ACTIVE | RNF_ROOT)) panic("active node flags=%x", rn->rn_flags); + rt = ((struct rtentry *)rn); + rtfree(rt); + return (0); } @@ -654,7 +657,8 @@ rtable_delete(unsigned int rtableid, struct sockaddr *dst, rt->rt_node = NULL; rt->rt_mask = NULL; LIST_REMOVE(rt, rt_next); - KASSERT(rt->rt_refcnt >= 0); + KASSERT(rt->rt_refcnt >= 1); + rtfree(rt); #ifndef SMALL_KERNEL if ((rt = LIST_FIRST(&an->an_rtlist)) != NULL) { |