diff options
author | Henning Brauer <henning@cvs.openbsd.org> | 2002-07-19 11:12:43 +0000 |
---|---|---|
committer | Henning Brauer <henning@cvs.openbsd.org> | 2002-07-19 11:12:43 +0000 |
commit | d609606b2ae78a686955c77b7e7712836a88f4b1 (patch) | |
tree | ff7d1320006d3f17f604a0fc97d11bb39e789473 | |
parent | 20e92287cf2df3c4ee1a040bfad461e66d65b654 (diff) |
deal with the fact that the struct node_host ifa_pick_ip gets is not always
the result of an interface expansion. in this case ifa_pick_ip does an
address family check (that's actually a (wanted) side effect). Thus, we need
to spit out a meaningfull error message in case of a mismatch.
also adjust all the other error messages, they were also assuming that nh is
the result of an interface expansion.
after a looooong discussion on icb (dhartmei@, pb@, me) we agreed on the term
"translation address" for that.
okay dhartmei@
-rw-r--r-- | sbin/pfctl/parse.y | 16 |
1 files changed, 10 insertions, 6 deletions
diff --git a/sbin/pfctl/parse.y b/sbin/pfctl/parse.y index ab772f0c0ad..3b74898fb1a 100644 --- a/sbin/pfctl/parse.y +++ b/sbin/pfctl/parse.y @@ -1,4 +1,4 @@ -/* $OpenBSD: parse.y,v 1.122 2002/07/17 08:32:20 henning Exp $ */ +/* $OpenBSD: parse.y,v 1.123 2002/07/19 11:12:42 henning Exp $ */ /* * Copyright (c) 2001 Markus Friedl. All rights reserved. @@ -2711,21 +2711,25 @@ ifa_pick_ip(struct node_host *nh, u_int8_t af) { struct node_host *h, *n = NULL; - if (af == 0 && nh->next) { - yyerror("address family not given and interface has multiple " - "IPs"); + if (af == 0 && nh && nh->next) { + yyerror("address family not given and translation address " + "expands to multiple IPs"); return(NULL); } for(h = nh; h; h = h->next) { if (h->af == af || h->af == 0 || af == 0) { if (n != NULL) { - yyerror("interface has multiple IPs of " - "this address family"); + yyerror("translation address expands to " + "multiple IPs of this address family"); return(NULL); } n = h; } } + + if (n == NULL) + yyerror("no translation address with matching address family " + "found."); return n; } |