summaryrefslogtreecommitdiff
path: root/sys
diff options
context:
space:
mode:
Diffstat (limited to 'sys')
-rw-r--r--sys/net/pf.c7
1 files changed, 4 insertions, 3 deletions
diff --git a/sys/net/pf.c b/sys/net/pf.c
index 8cb7f7f8836..5673ed3ff1e 100644
--- a/sys/net/pf.c
+++ b/sys/net/pf.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: pf.c,v 1.115 2001/07/17 21:54:25 provos Exp $ */
+/* $OpenBSD: pf.c,v 1.116 2001/07/18 22:24:07 dhartmei Exp $ */
/*
* Copyright (c) 2001, Daniel Hartmeier
@@ -1362,8 +1362,9 @@ pf_get_rdr(struct ifnet *ifp, u_int8_t proto, u_int32_t saddr, u_int32_t daddr,
(!r->proto || r->proto == proto) &&
pf_match_addr(r->snot, r->saddr, r->smask, saddr) &&
pf_match_addr(r->dnot, r->daddr, r->dmask, daddr) &&
- (ntohs(dport) >= ntohs(r->dport)) &&
- (ntohs(dport) <= ntohs(r->dport2)))
+ ((!r->dport2 && dport == r->dport) ||
+ (r->dport2 && (ntohs(dport) >= ntohs(r->dport)) &&
+ ntohs(dport) <= ntohs(r->dport2))))
rm = r;
else
r = TAILQ_NEXT(r, entries);