diff options
author | 2016-06-01 06:31:52 +0000 | |
---|---|---|
committer | 2016-06-01 06:31:52 +0000 | |
commit | 55ec0aa0320cd90f4682529403f03bd486ff7e34 (patch) | |
tree | b49681b46a23f56c9e7906b5d91f9e7a5e826066 | |
parent | Fix the loop iterating on extended capabilities. It turns out that we (diff) | |
download | wireguard-openbsd-55ec0aa0320cd90f4682529403f03bd486ff7e34.tar.xz wireguard-openbsd-55ec0aa0320cd90f4682529403f03bd486ff7e34.zip |
rtref and rtfree around moving the rt in rtable_mpath_reprio so the list
operations cant drop the refcount to 0.
ok mpi@
-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); } |