diff options
author | Oliver Ford <ojford@gmail.com> | 2017-05-05 11:11:50 +0000 |
---|---|---|
committer | Pablo Neira Ayuso <pablo@gnumonks.org> | 2017-05-08 20:01:38 +0200 |
commit | c29d99c83d95ca063fd378bd0b7f798eb66163fb (patch) | |
tree | 8c6420e1ec4c5543db0278def50064a8341b0e91 | |
parent | 1fe96cfb71baa915d02d7734739bed7ecc9d79cd (diff) |
libxtables: Display weird character warning for wildcards
Change the scope of the weird character check loop so that
it checks for invalid characters when the interface name
contains a wildcard.
Fixes Bugzilla #1085.
Signed-off-by: Oliver Ford <ojford@gmail.com>
Signed-off-by: Pablo Neira Ayuso <pablo@gnumonks.org>
-rw-r--r-- | libxtables/xtables.c | 18 |
1 files changed, 9 insertions, 9 deletions
diff --git a/libxtables/xtables.c b/libxtables/xtables.c index 891d81a7..57a11022 100644 --- a/libxtables/xtables.c +++ b/libxtables/xtables.c @@ -538,15 +538,15 @@ void xtables_parse_interface(const char *arg, char *vianame, } else { /* Include nul-terminator in match */ memset(mask, 0xFF, vialen + 1); - for (i = 0; vianame[i]; i++) { - if (vianame[i] == '/' || - vianame[i] == ' ') { - fprintf(stderr, - "Warning: weird character in interface" - " `%s' ('/' and ' ' are not allowed by the kernel).\n", - vianame); - break; - } + } + + /* Display warning on invalid characters */ + for (i = 0; vianame[i]; i++) { + if (vianame[i] == '/' || vianame[i] == ' ') { + fprintf(stderr, "Warning: weird character in interface" + " `%s' ('/' and ' ' are not allowed by the kernel).\n", + vianame); + break; } } } |