diff options
author | sam <sam@FreeBSD.org> | 2003-12-07 21:44:14 +0000 |
---|---|---|
committer | sam <sam@FreeBSD.org> | 2003-12-07 21:44:14 +0000 |
commit | f472357a27642db6d335217d107fd3d7ce83b52d (patch) | |
tree | 1411d5c6cbdedf605c11966d128597cb8d78e396 /sys/net | |
parent | 42af1b89fd6e6fca153be177a915c9e2f8128f80 (diff) | |
download | FreeBSD-src-f472357a27642db6d335217d107fd3d7ce83b52d.zip FreeBSD-src-f472357a27642db6d335217d107fd3d7ce83b52d.tar.gz |
bandaid LOR in rt_setgate; a proper fix requires code refactoring
Diffstat (limited to 'sys/net')
-rw-r--r-- | sys/net/route.c | 11 |
1 files changed, 7 insertions, 4 deletions
diff --git a/sys/net/route.c b/sys/net/route.c index 12c4f97..b059f2a 100644 --- a/sys/net/route.c +++ b/sys/net/route.c @@ -1090,8 +1090,12 @@ rt_setgate(struct rtentry *rt, struct sockaddr *dst, struct sockaddr *gate) * XXX: After removal of PRCLONING this is probably not needed anymore. */ if (rt->rt_flags & RTF_GATEWAY) { - /* XXX LOR here */ - rt->rt_gwroute = rtalloc1(gate, 1, 0); + struct rtentry *gwrt; + + RT_UNLOCK(rt); /* XXX workaround LOR */ + gwrt = rtalloc1(gate, 1, 0); + RT_LOCK(rt); + rt->rt_gwroute = gwrt; if (rt->rt_gwroute == rt) { RTFREE_LOCKED(rt->rt_gwroute); rt->rt_gwroute = 0; @@ -1111,8 +1115,7 @@ rt_setgate(struct rtentry *rt, struct sockaddr *dst, struct sockaddr *gate) arg.rnh = rnh; arg.rt0 = rt; - /* XXX workaround LOR */ - RT_UNLOCK(rt); + RT_UNLOCK(rt); /* XXX workaround LOR */ RADIX_NODE_HEAD_LOCK(rnh); RT_LOCK(rt); rnh->rnh_walktree_from(rnh, rt_key(rt), rt_mask(rt), |