summaryrefslogtreecommitdiff
path: root/sbin/pfctl/parse.y
diff options
context:
space:
mode:
authorDaniel Hartmeier <dhartmei@cvs.openbsd.org>2005-01-27 15:30:36 +0000
committerDaniel Hartmeier <dhartmei@cvs.openbsd.org>2005-01-27 15:30:36 +0000
commitdb2e8509fd98c86caac96035652519f2d162f283 (patch)
treecf2c450fd27063a3610a0829c35567d866eb39c1 /sbin/pfctl/parse.y
parent711496cca72868b66c8a2e3b107af235e483e5ab (diff)
dynamic interface names must start with a letter. catches the nonsensical
"(10.1.2.3)" that results from a simple typo like "$(ext_ip)" instead of "$(ext_if)".
Diffstat (limited to 'sbin/pfctl/parse.y')
-rw-r--r--sbin/pfctl/parse.y7
1 files changed, 6 insertions, 1 deletions
diff --git a/sbin/pfctl/parse.y b/sbin/pfctl/parse.y
index 29ee7d01825..f5fd8ac97bc 100644
--- a/sbin/pfctl/parse.y
+++ b/sbin/pfctl/parse.y
@@ -1,4 +1,4 @@
-/* $OpenBSD: parse.y,v 1.474 2005/01/05 18:23:10 mcbride Exp $ */
+/* $OpenBSD: parse.y,v 1.475 2005/01/27 15:30:35 dhartmei Exp $ */
/*
* Copyright (c) 2001 Markus Friedl. All rights reserved.
@@ -2307,6 +2307,11 @@ dynaddr : '(' STRING ')' {
char *p, *op;
op = $2;
+ if (!isalpha(op[0])) {
+ yyerror("invalid interface name '%s'", op);
+ free(op);
+ YYERROR;
+ }
while ((p = strrchr($2, ':')) != NULL) {
if (!strcmp(p+1, "network"))
flags |= PFI_AFLAG_NETWORK;