diff options
author | kmacy <kmacy@FreeBSD.org> | 2008-12-13 20:18:05 +0000 |
---|---|---|
committer | kmacy <kmacy@FreeBSD.org> | 2008-12-13 20:18:05 +0000 |
commit | 658f51b3ec1b3d0a9053440585eb463848083688 (patch) | |
tree | 42ab147b5ffe91feceb7a8c5a2e69ed01a5f18c8 | |
parent | 2a8fe85d73e3e1eee0328df30c45b9af7308d4ce (diff) | |
download | FreeBSD-src-658f51b3ec1b3d0a9053440585eb463848083688.zip FreeBSD-src-658f51b3ec1b3d0a9053440585eb463848083688.tar.gz |
radix node head lock needs to be held when calling rnh_addaddr
-rw-r--r-- | sys/netinet/ip_fw2.c | 2 |
1 files changed, 2 insertions, 0 deletions
diff --git a/sys/netinet/ip_fw2.c b/sys/netinet/ip_fw2.c index 826be2b..5d5da9f 100644 --- a/sys/netinet/ip_fw2.c +++ b/sys/netinet/ip_fw2.c @@ -1826,7 +1826,9 @@ add_table_entry(struct ip_fw_chain *ch, uint16_t tbl, in_addr_t addr, ent->mask.sin_addr.s_addr = htonl(mlen ? ~((1 << (32 - mlen)) - 1) : 0); ent->addr.sin_addr.s_addr = addr & ent->mask.sin_addr.s_addr; IPFW_WLOCK(ch); + RADIX_NODE_HEAD_LOCK(rnh); if (rnh->rnh_addaddr(&ent->addr, &ent->mask, rnh, (void *)ent) == + RADIX_NODE_HEAD_UNLOCK(rnh); NULL) { IPFW_WUNLOCK(ch); free(ent, M_IPFW_TBL); |