summaryrefslogtreecommitdiffstats
path: root/sys/netinet/ip_fw.c
diff options
context:
space:
mode:
authoradam <adam@FreeBSD.org>1997-01-16 21:04:29 +0000
committeradam <adam@FreeBSD.org>1997-01-16 21:04:29 +0000
commit752ba4d26f2e94cc31940f50407a6b18b86ee0e8 (patch)
tree4a96909d7420e2da778a9c97b865c7b2d9a54dba /sys/netinet/ip_fw.c
parent104d3c9ef67e45cdbb45100d6f7416ad9f6c75ba (diff)
downloadFreeBSD-src-752ba4d26f2e94cc31940f50407a6b18b86ee0e8.zip
FreeBSD-src-752ba4d26f2e94cc31940f50407a6b18b86ee0e8.tar.gz
implement "not" keyword for inverting the address logic
Diffstat (limited to 'sys/netinet/ip_fw.c')
-rw-r--r--sys/netinet/ip_fw.c6
1 files changed, 4 insertions, 2 deletions
diff --git a/sys/netinet/ip_fw.c b/sys/netinet/ip_fw.c
index b62f6d7..f006bc6 100644
--- a/sys/netinet/ip_fw.c
+++ b/sys/netinet/ip_fw.c
@@ -320,11 +320,13 @@ ip_fw_chk(struct ip **pip, int hlen,
continue;
/* If src-addr doesn't match, not this rule. */
- if ((src.s_addr & f->fw_smsk.s_addr) != f->fw_src.s_addr)
+ if ((f->fw_flg & IP_FW_F_INVSRC) != 0
+ ^ (src.s_addr & f->fw_smsk.s_addr) != f->fw_src.s_addr)
continue;
/* If dest-addr doesn't match, not this rule. */
- if ((dst.s_addr & f->fw_dmsk.s_addr) != f->fw_dst.s_addr)
+ if ((f->fw_flg & IP_FW_F_INVDST) != 0
+ ^ (dst.s_addr & f->fw_dmsk.s_addr) != f->fw_dst.s_addr)
continue;
/* If a i/f name was specified, and we don't know */
OpenPOWER on IntegriCloud