come on Julian, make up if you're committing one change or the other.

fix braino
This commit is contained in:
Julian Elischer 2008-09-14 10:22:37 +00:00
parent c43aea0f68
commit 5e7b481acf
2 changed files with 29 additions and 13 deletions

View File

@ -1698,7 +1698,7 @@ rt_check(struct rtentry **lrt, struct rtentry **lrt0, struct sockaddr *dst)
KASSERT(*lrt0 != NULL, ("rt_check"));
rt = rt0 = *lrt0;
fibnum = (*rt0)->rt_fibnum;
fibnum = rt0->rt_fibnum;
/* NB: the locking here is tortuous... */
RT_LOCK(rt);

View File

@ -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];