summaryrefslogtreecommitdiffstats
path: root/sys/net/route.h
diff options
context:
space:
mode:
authorjulian <julian@FreeBSD.org>2008-09-14 10:22:37 +0000
committerjulian <julian@FreeBSD.org>2008-09-14 10:22:37 +0000
commit87628fd213cbfdff692cb411ac64d4f006a8e6e4 (patch)
tree68b0d8093731a764271978f0b9097ad6b742bc7a /sys/net/route.h
parentbf08111cf0727a2a5f268f25cdb222e318b3e447 (diff)
downloadFreeBSD-src-87628fd213cbfdff692cb411ac64d4f006a8e6e4.zip
FreeBSD-src-87628fd213cbfdff692cb411ac64d4f006a8e6e4.tar.gz
come on Julian, make up if you're committing one change or the other.
fix braino
Diffstat (limited to 'sys/net/route.h')
-rw-r--r--sys/net/route.h40
1 files changed, 28 insertions, 12 deletions
diff --git a/sys/net/route.h b/sys/net/route.h
index 2c9afb2..249a41e 100644
--- a/sys/net/route.h
+++ b/sys/net/route.h
@@ -316,20 +316,36 @@ struct rt_addrinfo {
} while (0)
#define RTFREE_LOCKED(_rt) do { \
- if ((_rt)->rt_refcnt <= 1) \
- rtfree(_rt); \
- else { \
- RT_REMREF(_rt); \
- RT_UNLOCK(_rt); \
- } \
- /* guard against invalid refs */ \
- _rt = 0; \
- } while (0)
+ if ((_rt)->rt_refcnt <= 1) \
+ rtfree(_rt); \
+ else { \
+ RT_REMREF(_rt); \
+ RT_UNLOCK(_rt); \
+ } \
+ /* guard against invalid refs */ \
+ _rt = 0; \
+} while (0)
#define RTFREE(_rt) do { \
- RT_LOCK(_rt); \
- RTFREE_LOCKED(_rt); \
- } while (0)
+ RT_LOCK(_rt); \
+ RTFREE_LOCKED(_rt); \
+} while (0)
+
+#define RT_TEMP_UNLOCK(_rt) do { \
+ RT_ADDREF(_rt); \
+ RT_UNLOCK(_rt); \
+} while (0)
+
+#define RT_RELOCK(_rt) do { \
+ RT_LOCK(_rt); \
+ if ((_rt)->rt_refcnt <= 1) { \
+ rtfree(_rt); \
+ _rt = 0; /* signal that it went away */ \
+ } else { \
+ RT_REMREF(_rt); \
+ /* note that _rt is still valid */ \
+ } \
+} while (0)
extern struct radix_node_head *rt_tables[][AF_MAX+1];
OpenPOWER on IntegriCloud