summaryrefslogtreecommitdiffstats
path: root/sys/net/route.h
diff options
context:
space:
mode:
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