Add assertion to enforce 'nat global' locking requierements changed by r241908.
Suggested by: adrian, glebius MFC after: 3 days
This commit is contained in:
parent
6056a71b0e
commit
e570ee3854
@ -276,6 +276,7 @@ ipfw_nat(struct ip_fw_args *args, struct cfg_nat *t, struct mbuf *m)
|
||||
|
||||
found = 0;
|
||||
chain = &V_layer3_chain;
|
||||
IPFW_RLOCK_ASSERT(chain);
|
||||
/* Check every nat entry... */
|
||||
LIST_FOREACH(t, &chain->nat, _next) {
|
||||
if ((t->mode & PKT_ALIAS_SKIP_GLOBAL) != 0)
|
||||
|
@ -251,6 +251,7 @@ struct sockopt; /* used by tcp_var.h */
|
||||
rw_destroy(&(_chain)->uh_lock); \
|
||||
} while (0)
|
||||
|
||||
#define IPFW_RLOCK_ASSERT(_chain) rw_assert(&(_chain)->rwmtx, RA_RLOCKED)
|
||||
#define IPFW_WLOCK_ASSERT(_chain) rw_assert(&(_chain)->rwmtx, RA_WLOCKED)
|
||||
|
||||
#define IPFW_RLOCK(p) rw_rlock(&(p)->rwmtx)
|
||||
|
Loading…
Reference in New Issue
Block a user