diff options
author | Daniel Hartmeier <dhartmei@cvs.openbsd.org> | 2001-10-24 09:18:36 +0000 |
---|---|---|
committer | Daniel Hartmeier <dhartmei@cvs.openbsd.org> | 2001-10-24 09:18:36 +0000 |
commit | 0cdec1df3586b195d7ad23c8af9598b729bbc648 (patch) | |
tree | 79dbf6cd284cfa86f41c1a9a6392c13592cdee6a /sbin | |
parent | d10166eb2b6eca35a4dd5dd5ad7b73a6125da54a (diff) |
Check interface names using ifa0_lookup() and print error message for
non-existant interfaces (instead of the generic ioctl error returned by
the kernel in this case).
Diffstat (limited to 'sbin')
-rw-r--r-- | sbin/pfctl/parse.y | 6 |
1 files changed, 5 insertions, 1 deletions
diff --git a/sbin/pfctl/parse.y b/sbin/pfctl/parse.y index 8e4404f4073..4b5742b6561 100644 --- a/sbin/pfctl/parse.y +++ b/sbin/pfctl/parse.y @@ -1,4 +1,4 @@ -/* $OpenBSD: parse.y,v 1.41 2001/10/15 16:22:22 dhartmei Exp $ */ +/* $OpenBSD: parse.y,v 1.42 2001/10/24 09:18:35 dhartmei Exp $ */ /* * Copyright (c) 2001 Markus Friedl. All rights reserved. @@ -308,6 +308,10 @@ if_item_not : '!' if_item { $$ = $2; $$->not = 1; } | if_item { $$ = $1; } if_item : STRING { + if (ifa0_lookup($1) == NULL) { + yyerror("unknown interface %s", $1); + YYERROR; + } $$ = malloc(sizeof(struct node_if)); if ($$ == NULL) err(1, "if_item: malloc"); |