summaryrefslogtreecommitdiff
path: root/sbin
diff options
context:
space:
mode:
authorHenning Brauer <henning@cvs.openbsd.org>2003-06-12 09:40:34 +0000
committerHenning Brauer <henning@cvs.openbsd.org>2003-06-12 09:40:34 +0000
commit1c43046854d2c47688d03a9aef920a6312d443c7 (patch)
tree3ffcd94edbe76ce01d5daa85850671e6b17b7da7 /sbin
parentefe7a6c2b33ff4c96a3415d06f5090c473f28991 (diff)
in set_ipmask, do not try to mask off irrelevant bits of anything but
PF_ADDRMASK. due to the union this resulted in "masking" interface names in the dynaddr case... <henning@quigon:1>$ echo "pass inet from (le0)/8" | pfctl -nvf - pass inet from (l)/8 to any reported by AARON SUEN <ags137 at psu.edu> on misc@
Diffstat (limited to 'sbin')
-rw-r--r--sbin/pfctl/pfctl_parser.c7
1 files changed, 4 insertions, 3 deletions
diff --git a/sbin/pfctl/pfctl_parser.c b/sbin/pfctl/pfctl_parser.c
index 23e229f5d69..78553943946 100644
--- a/sbin/pfctl/pfctl_parser.c
+++ b/sbin/pfctl/pfctl_parser.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: pfctl_parser.c,v 1.163 2003/06/11 02:54:02 itojun Exp $ */
+/* $OpenBSD: pfctl_parser.c,v 1.164 2003/06/12 09:40:33 henning Exp $ */
/*
* Copyright (c) 2001 Daniel Hartmeier
@@ -798,8 +798,9 @@ set_ipmask(struct node_host *h, u_int8_t b)
/* Mask off bits of the address that will never be used. */
n = &h->addr.v.a.addr;
- for (i = 0; i < 4; i++)
- n->addr32[i] = n->addr32[i] & m->addr32[i];
+ if (h->addr.type == PF_ADDR_ADDRMASK)
+ for (i = 0; i < 4; i++)
+ n->addr32[i] = n->addr32[i] & m->addr32[i];
}
int