From affd738f0531e9799db4ec0d6dec94381e6c19b3 Mon Sep 17 00:00:00 2001 From: Cedric Berger Date: Sat, 19 Jul 2003 13:08:59 +0000 Subject: Simplify struct pf_pooladdr to include struct pf_addr_wrap directly instead of indirectly trough struct pf_rule_addr. Ryan McBride says: If I'm not mistaken, the code _used_ to use the ports in pf_rule_addr as well. The code was changed to fix some of the bugs with port ranges, but it was too late in the release cycle to make kernel API changes, so the structure was left as is. Needless to say: KERNEL/USERLAND SYNC REQUIRED. ok henning@ mcbride@ --- sbin/pfctl/parse.y | 10 +++++----- sbin/pfctl/pfctl_parser.c | 8 ++++---- 2 files changed, 9 insertions(+), 9 deletions(-) (limited to 'sbin') diff --git a/sbin/pfctl/parse.y b/sbin/pfctl/parse.y index ad3f560a797..8ffb82445c8 100644 --- a/sbin/pfctl/parse.y +++ b/sbin/pfctl/parse.y @@ -1,4 +1,4 @@ -/* $OpenBSD: parse.y,v 1.402 2003/07/18 06:30:06 cedric Exp $ */ +/* $OpenBSD: parse.y,v 1.403 2003/07/19 13:08:58 cedric Exp $ */ /* * Copyright (c) 2001 Markus Friedl. All rights reserved. @@ -2823,7 +2823,7 @@ binatrule : no BINAT natpass interface af proto FROM host TO ipspec tag pa = calloc(1, sizeof(struct pf_pooladdr)); if (pa == NULL) err(1, "binat: calloc"); - pa->addr.addr = $12->host->addr; + pa->addr = $12->host->addr; pa->ifname[0] = 0; TAILQ_INSERT_TAIL(&binat.rpool.list, pa, entries); @@ -3107,7 +3107,7 @@ nat_consistent(struct pf_rule *r) } if (!r->af) { TAILQ_FOREACH(pa, &r->rpool.list, entries) { - if (pa->addr.addr.type == PF_ADDR_DYNIFTL) { + if (pa->addr.type == PF_ADDR_DYNIFTL) { yyerror("dynamic addresses require " "address family (inet/inet6)"); problems++; @@ -3156,7 +3156,7 @@ rdr_consistent(struct pf_rule *r) problems++; } else { TAILQ_FOREACH(pa, &r->rpool.list, entries) { - if (pa->addr.addr.type == PF_ADDR_DYNIFTL) { + if (pa->addr.type == PF_ADDR_DYNIFTL) { yyerror("dynamic addresses require " "address family (inet/inet6)"); problems++; @@ -3752,7 +3752,7 @@ expand_rule(struct pf_rule *r, pa = calloc(1, sizeof(struct pf_pooladdr)); if (pa == NULL) err(1, "expand_rule: calloc"); - pa->addr.addr = h->addr; + pa->addr = h->addr; if (h->ifname != NULL) { if (strlcpy(pa->ifname, h->ifname, sizeof(pa->ifname)) >= diff --git a/sbin/pfctl/pfctl_parser.c b/sbin/pfctl/pfctl_parser.c index 7b3ccc560a0..0ab6ea0d908 100644 --- a/sbin/pfctl/pfctl_parser.c +++ b/sbin/pfctl/pfctl_parser.c @@ -1,4 +1,4 @@ -/* $OpenBSD: pfctl_parser.c,v 1.169 2003/07/15 17:12:38 cedric Exp $ */ +/* $OpenBSD: pfctl_parser.c,v 1.170 2003/07/19 13:08:58 cedric Exp $ */ /* * Copyright (c) 2001 Daniel Hartmeier @@ -398,14 +398,14 @@ print_pool(struct pf_pool *pool, u_int16_t p1, u_int16_t p2, case PF_NAT: case PF_RDR: case PF_BINAT: - print_addr(&pooladdr->addr.addr, af, 0); + print_addr(&pooladdr->addr, af, 0); break; case PF_PASS: - if (PF_AZERO(&pooladdr->addr.addr.v.a.addr, af)) + if (PF_AZERO(&pooladdr->addr.v.a.addr, af)) printf("%s", pooladdr->ifname); else { printf("(%s ", pooladdr->ifname); - print_addr(&pooladdr->addr.addr, af, 0); + print_addr(&pooladdr->addr, af, 0); printf(")"); } break; -- cgit v1.2.3