summaryrefslogtreecommitdiff
path: root/sbin/pfctl/pfctl_parser.c
diff options
context:
space:
mode:
authorRyan Thomas McBride <mcbride@cvs.openbsd.org>2003-06-09 11:14:47 +0000
committerRyan Thomas McBride <mcbride@cvs.openbsd.org>2003-06-09 11:14:47 +0000
commit1d91b777b103ae8b2efd63f1ebb323155c321042 (patch)
tree1acebcb599c65d3a79704eefecf034d1d6c8c29f /sbin/pfctl/pfctl_parser.c
parent76dec48ee61d92aa40c3575a43c83d570afdcbd2 (diff)
Attempt to resolve byte order confusion in nat code once and for all.
- pf_get_sport() leaves the translated port in the packet in network byte order - merge code for the p1=0 p2=0 case and static-port case in pr_get_sport() NOTE: people who use the static-port keyword in their pf.conf need to make sure pfctl is updated along with their kernel.
Diffstat (limited to 'sbin/pfctl/pfctl_parser.c')
-rw-r--r--sbin/pfctl/pfctl_parser.c8
1 files changed, 4 insertions, 4 deletions
diff --git a/sbin/pfctl/pfctl_parser.c b/sbin/pfctl/pfctl_parser.c
index 5881be4686c..d0f0773d943 100644
--- a/sbin/pfctl/pfctl_parser.c
+++ b/sbin/pfctl/pfctl_parser.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: pfctl_parser.c,v 1.161 2003/05/24 19:14:06 henning Exp $ */
+/* $OpenBSD: pfctl_parser.c,v 1.162 2003/06/09 11:14:46 mcbride Exp $ */
/*
* Copyright (c) 2001 Daniel Hartmeier
@@ -419,8 +419,8 @@ print_pool(struct pf_pool *pool, u_int16_t p1, u_int16_t p2,
}
switch (id) {
case PF_NAT:
- if (p1 != PF_NAT_PROXY_PORT_LOW ||
- p2 != PF_NAT_PROXY_PORT_HIGH) {
+ if ((p1 != PF_NAT_PROXY_PORT_LOW ||
+ p2 != PF_NAT_PROXY_PORT_HIGH) && (p1 != 0 || p2 != 0)) {
if (p1 == p2)
printf(" port %u", p1);
else
@@ -455,7 +455,7 @@ print_pool(struct pf_pool *pool, u_int16_t p1, u_int16_t p2,
printf(" round-robin");
break;
}
- if (pool->opts & PF_POOL_STATICPORT)
+ if (id == PF_NAT && p1 == 0 && p2 == 0)
printf(" static-port");
}