diff options
author | David Gwynne <dlg@cvs.openbsd.org> | 2016-06-01 06:31:53 +0000 |
---|---|---|
committer | David Gwynne <dlg@cvs.openbsd.org> | 2016-06-01 06:31:53 +0000 |
commit | f2c2d07c96ba0f1f99d988681a407e201c89d41f (patch) | |
tree | 11efc9693ca30c4c76f6e2f67ef6539cd33adf66 /sys/net | |
parent | ddc8f776d17ca84199ae6e5b90647e412907935e (diff) |
rtref and rtfree around moving the rt in rtable_mpath_reprio so the list
operations cant drop the refcount to 0.
ok mpi@
Diffstat (limited to 'sys/net')
-rw-r--r-- | sys/net/rtable.c | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/sys/net/rtable.c b/sys/net/rtable.c index 7b05555c543..ed80c98c1b1 100644 --- a/sys/net/rtable.c +++ b/sys/net/rtable.c @@ -1,4 +1,4 @@ -/* $OpenBSD: rtable.c,v 1.43 2016/06/01 06:19:06 dlg Exp $ */ +/* $OpenBSD: rtable.c,v 1.44 2016/06/01 06:31:52 dlg Exp $ */ /* * Copyright (c) 2014-2015 Martin Pieuchot @@ -897,6 +897,7 @@ rtable_mpath_reprio(unsigned int rtableid, struct sockaddr *dst, KERNEL_ASSERT_LOCKED(); + rtref(rt); /* keep rt alive in between remove and add */ SRPL_REMOVE_LOCKED(&rt_rc, &an->an_rtlist, rt, rtentry, rt_next); rt->rt_priority = prio; @@ -929,6 +930,7 @@ rtable_mpath_reprio(unsigned int rtableid, struct sockaddr *dst, } else { SRPL_INSERT_HEAD_LOCKED(&rt_rc, &an->an_rtlist, rt, rt_next); } + rtfree(rt); return (0); } |