summaryrefslogtreecommitdiffstats
path: root/sys/net/route.c
diff options
context:
space:
mode:
authorkmacy <kmacy@FreeBSD.org>2009-07-11 21:56:23 +0000
committerkmacy <kmacy@FreeBSD.org>2009-07-11 21:56:23 +0000
commitccb66bdf1d7bed0d4b913727dc591bd5dc7f119f (patch)
tree126951e7b9f9628460e1ffc8d66932710ccfb1a2 /sys/net/route.c
parent01fee564e1bcd931b3ee148c3ef9023c1547e2a2 (diff)
downloadFreeBSD-src-ccb66bdf1d7bed0d4b913727dc591bd5dc7f119f.zip
FreeBSD-src-ccb66bdf1d7bed0d4b913727dc591bd5dc7f119f.tar.gz
Re-factoring for adding weighted routes introduced a
fairly irritating bug where the system will panic when RADIX_MPATH is enabled. This change fixes this. Approved by: re@
Diffstat (limited to 'sys/net/route.c')
-rw-r--r--sys/net/route.c12
1 files changed, 11 insertions, 1 deletions
diff --git a/sys/net/route.c b/sys/net/route.c
index a3dc169..750829a 100644
--- a/sys/net/route.c
+++ b/sys/net/route.c
@@ -987,7 +987,16 @@ rn_mpath_update(int req, struct rt_addrinfo *info,
(rt->rt_gateway->sa_len != gateway->sa_len ||
memcmp(rt->rt_gateway, gateway, gateway->sa_len)))
error = ESRCH;
- goto done;
+ else {
+ /*
+ * remove from tree before returning it
+ * to the caller
+ */
+ rn = rnh->rnh_deladdr(dst, netmask, rnh);
+ KASSERT(rt == RNTORT(rn), ("radix node disappeared"));
+ goto gwdelete;
+ }
+
}
/*
* use the normal delete code to remove
@@ -1005,6 +1014,7 @@ rn_mpath_update(int req, struct rt_addrinfo *info,
*/
if ((req == RTM_DELETE) && !rt_mpath_deldup(rto, rt))
panic ("rtrequest1: rt_mpath_deldup");
+gwdelete:
RT_LOCK(rt);
RT_ADDREF(rt);
if (req == RTM_DELETE) {
OpenPOWER on IntegriCloud