summaryrefslogtreecommitdiff
path: root/sys/net/pf.c
diff options
context:
space:
mode:
authorPeter Stromberg <wilfried@cvs.openbsd.org>2001-06-26 12:27:17 +0000
committerPeter Stromberg <wilfried@cvs.openbsd.org>2001-06-26 12:27:17 +0000
commitc7af11680054187833afcdf5fbfbb7fa96b05977 (patch)
treee08c6fec65a1ba6b5340c1666000231401e2113f /sys/net/pf.c
parent6312d6ab80fc66dbfc9a06b27296aa8399d65fb0 (diff)
allow 0.0.0.0/x in rules
Diffstat (limited to 'sys/net/pf.c')
-rw-r--r--sys/net/pf.c14
1 files changed, 7 insertions, 7 deletions
diff --git a/sys/net/pf.c b/sys/net/pf.c
index 15e7445899b..eab95e07279 100644
--- a/sys/net/pf.c
+++ b/sys/net/pf.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: pf.c,v 1.49 2001/06/26 11:17:31 dhartmei Exp $ */
+/* $OpenBSD: pf.c,v 1.50 2001/06/26 12:27:16 wilfried Exp $ */
/*
* Copyright (c) 2001, Daniel Hartmeier
@@ -1253,9 +1253,9 @@ pf_test_tcp(int direction, struct ifnet *ifp, struct mbuf **m,
(r->ifp == NULL || r->ifp == ifp) &&
(!r->proto || r->proto == IPPROTO_TCP) &&
((th->th_flags & r->flagset) == r->flags) &&
- (!r->src.addr || match_addr(r->src.not, r->src.addr,
+ ((!r->src.addr && !r->src.mask) || match_addr(r->src.not, r->src.addr,
r->src.mask, h->ip_src.s_addr)) &&
- (!r->dst.addr || match_addr(r->dst.not, r->dst.addr,
+ ((!r->dst.addr && !r->dst.mask) || match_addr(r->dst.not, r->dst.addr,
r->dst.mask, h->ip_dst.s_addr)) &&
(!r->dst.port_op || match_port(r->dst.port_op, r->dst.port[0],
r->dst.port[1], th->th_dport)) &&
@@ -1399,9 +1399,9 @@ pf_test_udp(int direction, struct ifnet *ifp, struct mbuf **m,
if ((r->direction == direction) &&
((r->ifp == NULL) || (r->ifp == ifp)) &&
(!r->proto || (r->proto == IPPROTO_UDP)) &&
- (!r->src.addr || match_addr(r->src.not, r->src.addr,
+ ((!r->src.addr && !r->src.mask) || match_addr(r->src.not, r->src.addr,
r->src.mask, h->ip_src.s_addr)) &&
- (!r->dst.addr || match_addr(r->dst.not, r->dst.addr,
+ ((!r->dst.addr && !r->dst.mask) || match_addr(r->dst.not, r->dst.addr,
r->dst.mask, h->ip_dst.s_addr)) &&
(!r->dst.port_op || match_port(r->dst.port_op, r->dst.port[0],
r->dst.port[1], uh->uh_dport)) &&
@@ -1511,9 +1511,9 @@ pf_test_icmp(int direction, struct ifnet *ifp, struct mbuf **m,
if ((r->direction == direction) &&
((r->ifp == NULL) || (r->ifp == ifp)) &&
(!r->proto || (r->proto == IPPROTO_ICMP)) &&
- (!r->src.addr || match_addr(r->src.not, r->src.addr,
+ ((!r->src.addr && !r->src.mask) || match_addr(r->src.not, r->src.addr,
r->src.mask, h->ip_src.s_addr)) &&
- (!r->dst.addr || match_addr(r->dst.not, r->dst.addr,
+ ((!r->dst.addr && !r->dst.mask) || match_addr(r->dst.not, r->dst.addr,
r->dst.mask, h->ip_dst.s_addr)) &&
(!r->type || (r->type == ih->icmp_type + 1)) &&
(!r->code || (r->code == ih->icmp_code + 1)) ) {