diff options
author | Martin Pieuchot <mpi@cvs.openbsd.org> | 2014-07-01 09:58:41 +0000 |
---|---|---|
committer | Martin Pieuchot <mpi@cvs.openbsd.org> | 2014-07-01 09:58:41 +0000 |
commit | deb9e1c22577c2274a5018664f096bebb9a5a8af (patch) | |
tree | 8cc7fd221542cc50d61315aa77fcdb0710d88756 /sys/net | |
parent | f06eb275f8532bb6a412aeef0a628c8a44db6daa (diff) |
KASSERT() the correct node if a hint is passed to rn_delete().
Fix a panic when trying to remove a route with the magical 0.0.0.0
destination.
looks ok to claudio@
Diffstat (limited to 'sys/net')
-rw-r--r-- | sys/net/radix.c | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/sys/net/radix.c b/sys/net/radix.c index 9830ff2112c..76da7383fe9 100644 --- a/sys/net/radix.c +++ b/sys/net/radix.c @@ -1,4 +1,4 @@ -/* $OpenBSD: radix.c,v 1.40 2014/05/27 19:38:15 claudio Exp $ */ +/* $OpenBSD: radix.c,v 1.41 2014/07/01 09:58:40 mpi Exp $ */ /* $NetBSD: radix.c,v 1.20 2003/08/07 16:32:56 agc Exp $ */ /* @@ -982,17 +982,17 @@ rn_delete(void *v_arg, void *n_arg, struct radix_node_head *head, return (0); } - KASSERT((tt->rn_flags & RNF_ROOT) == 0); - /* save start of multi path chain for later use */ dupedkey_tt = tt; #ifndef SMALL_KERNEL /* if we got a hint use the hint from now on */ - if (rn) + if (rn) tt = rn; #endif + KASSERT((tt->rn_flags & RNF_ROOT) == 0); + /* remove possible radix_mask */ if (rn_del_radix_mask(tt)) return (0); |