summaryrefslogtreecommitdiffstats
path: root/sys/net/route.h
diff options
context:
space:
mode:
authorhsu <hsu@FreeBSD.org>2003-07-19 00:21:13 +0000
committerhsu <hsu@FreeBSD.org>2003-07-19 00:21:13 +0000
commita84180a7b25cf60907f8afc3db1c7a2bf2e72f43 (patch)
tree5da2f72772bb7f838ed73b50bf14d194ef1d11f2 /sys/net/route.h
parent9db33cb1a78aa86a599b406c882115b97d8d1eeb (diff)
downloadFreeBSD-src-a84180a7b25cf60907f8afc3db1c7a2bf2e72f43.zip
FreeBSD-src-a84180a7b25cf60907f8afc3db1c7a2bf2e72f43.tar.gz
Add mutex for routing entries.
Reviewed by: bmilekic, silby
Diffstat (limited to 'sys/net/route.h')
-rw-r--r--sys/net/route.h9
1 files changed, 8 insertions, 1 deletions
diff --git a/sys/net/route.h b/sys/net/route.h
index c7e7529..79b796b 100644
--- a/sys/net/route.h
+++ b/sys/net/route.h
@@ -113,7 +113,7 @@ struct rtentry {
struct rtentry *);
/* output routine for this (rt,if) */
struct rtentry *rt_parent; /* cloning parent of this route */
- void *rt_filler2; /* more filler */
+ struct mtx *rt_mtx; /* mutex for routing entry */
};
/*
@@ -262,6 +262,13 @@ struct route_cb {
};
#ifdef _KERNEL
+
+#define RT_LOCK_INIT(rt) \
+ mtx_init((rt)->rt_mtx, "rtentry", NULL, MTX_DEF | MTX_DUPOK)
+#define RT_LOCK(rt) mtx_lock((rt)->rt_mtx)
+#define RT_UNLOCK(rt) mtx_unlock((rt)->rt_mtx)
+#define RT_LOCK_DESTROY(rt) mtx_destroy((rt)->rt_mtx)
+
#define RTFREE(rt) \
do { \
if ((rt)->rt_refcnt <= 1) \
OpenPOWER on IntegriCloud