summaryrefslogtreecommitdiffstats
path: root/sys/net/if_faith.c
diff options
context:
space:
mode:
authorsam <sam@FreeBSD.org>2003-10-04 03:44:50 +0000
committersam <sam@FreeBSD.org>2003-10-04 03:44:50 +0000
commit9d93fce265aeeeb266999d5092d6d4224cc16829 (patch)
tree7bd40aa381e3ec3f09e84ae6cc70b74bf5683aa2 /sys/net/if_faith.c
parent420e26096448ac273dab52190262aa9d55cb6c91 (diff)
downloadFreeBSD-src-9d93fce265aeeeb266999d5092d6d4224cc16829.zip
FreeBSD-src-9d93fce265aeeeb266999d5092d6d4224cc16829.tar.gz
Locking for updates to routing table entries. Each rtentry gets a mutex
that covers updates to the contents. Note this is separate from holding a reference and/or locking the routing table itself. Other/related changes: o rtredirect loses the final parameter by which an rtentry reference may be returned; this was never used and added unwarranted complexity for locking. o minor style cleanups to routing code (e.g. ansi-fy function decls) o remove the logic to bump the refcnt on the parent of cloned routes, we assume the parent will remain as long as the clone; doing this avoids a circularity in locking during delete o convert some timeouts to MPSAFE callouts Notes: 1. rt_mtx in struct rtentry is guarded by #ifdef _KERNEL as user-level applications cannot/do-no know about mutex's. Doing this requires that the mutex be the last element in the structure. A better solution is to introduce an externalized version of struct rtentry but this is a major task because of the intertwining of rtentry and other data structures that are visible to user applications. 2. There are known LOR's that are expected to go away with forthcoming work to eliminate many held references. If not these will be resolved prior to release. 3. ATM changes are untested. Sponsored by: FreeBSD Foundation Obtained from: BSD/OS (partly)
Diffstat (limited to 'sys/net/if_faith.c')
-rw-r--r--sys/net/if_faith.c4
1 files changed, 3 insertions, 1 deletions
diff --git a/sys/net/if_faith.c b/sys/net/if_faith.c
index 761f151..8a9cb7c 100644
--- a/sys/net/if_faith.c
+++ b/sys/net/if_faith.c
@@ -270,6 +270,8 @@ faithrtrequest(cmd, rt, info)
struct rtentry *rt;
struct rt_addrinfo *info;
{
+ RT_LOCK_ASSERT(rt);
+
if (rt) {
rt->rt_rmx.rmx_mtu = rt->rt_ifp->if_mtu; /* for ISO */
/*
@@ -371,7 +373,7 @@ faithprefix(in6)
else
ret = 0;
if (rt)
- RTFREE(rt);
+ RTFREE_LOCKED(rt);
return ret;
}
#endif
OpenPOWER on IntegriCloud