From db2e8509fd98c86caac96035652519f2d162f283 Mon Sep 17 00:00:00 2001 From: Daniel Hartmeier Date: Thu, 27 Jan 2005 15:30:36 +0000 Subject: 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)". --- sbin/pfctl/parse.y | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) (limited to 'sbin/pfctl') 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; -- cgit v1.2.3