diff options
author | Markus Friedl <markus@cvs.openbsd.org> | 2008-05-09 05:41:03 +0000 |
---|---|---|
committer | Markus Friedl <markus@cvs.openbsd.org> | 2008-05-09 05:41:03 +0000 |
commit | bda6c79c6118a8b96973eefec9bb095c9c668d3c (patch) | |
tree | f8fd4e1945a0ec89e34f3ba0df96d1e0147f6b76 /sbin/pfctl | |
parent | 02db58fa9d0c3680d164ba2017cdba712d977365 (diff) |
convert port byte order in the production; add port keyword; ok deraadt@
Diffstat (limited to 'sbin/pfctl')
-rw-r--r-- | sbin/pfctl/parse.y | 10 | ||||
-rw-r--r-- | sbin/pfctl/pfctl_parser.c | 4 |
2 files changed, 7 insertions, 7 deletions
diff --git a/sbin/pfctl/parse.y b/sbin/pfctl/parse.y index 2c4a2ce81d7..044405a8352 100644 --- a/sbin/pfctl/parse.y +++ b/sbin/pfctl/parse.y @@ -1,4 +1,4 @@ -/* $OpenBSD: parse.y,v 1.544 2008/05/09 02:44:54 markus Exp $ */ +/* $OpenBSD: parse.y,v 1.545 2008/05/09 05:41:01 markus Exp $ */ /* * Copyright (c) 2001 Markus Friedl. All rights reserved. @@ -2182,7 +2182,7 @@ pfrule : action dir logquick interface route af proto fromto } free($9.queues.pqname); } - if ((r.divert.port = htons($9.divert.port))) { + if ((r.divert.port = $9.divert.port)) { if (r.direction == PF_OUT) { if ($9.divert.addr) { yyerror("address specified " @@ -2322,7 +2322,7 @@ filter_opt : USER uids { } filter_opts.rtableid = $2; } - | DIVERTTO STRING number { + | DIVERTTO STRING PORT number { if ((filter_opts.divert.addr = host($2)) == NULL) { yyerror("could not parse divert address: %s", $2); @@ -2330,9 +2330,9 @@ filter_opt : USER uids { YYERROR; } free($2); - filter_opts.divert.port = $3; + filter_opts.divert.port = htons($4); if (!filter_opts.divert.port) { - yyerror("invalid divert port: %d", $3); + yyerror("invalid divert port: %d", $4); YYERROR; } } diff --git a/sbin/pfctl/pfctl_parser.c b/sbin/pfctl/pfctl_parser.c index 932eb357b0f..2194b7a7a63 100644 --- a/sbin/pfctl/pfctl_parser.c +++ b/sbin/pfctl/pfctl_parser.c @@ -1,4 +1,4 @@ -/* $OpenBSD: pfctl_parser.c,v 1.237 2008/05/09 02:44:55 markus Exp $ */ +/* $OpenBSD: pfctl_parser.c,v 1.238 2008/05/09 05:41:01 markus Exp $ */ /* * Copyright (c) 2001 Daniel Hartmeier @@ -996,7 +996,7 @@ print_rule(struct pf_rule *r, const char *anchor_call, int verbose) printf("?"); else printf("%s", buf); - printf(" %u", ntohs(r->divert.port)); + printf(" port %u", ntohs(r->divert.port)); } } if (!anchor_call[0] && (r->action == PF_NAT || |