]> git.ipfire.org Git - thirdparty/iptables.git/commitdiff
libxtables: Display weird character warning for wildcards
authorOliver Ford <ojford@gmail.com>
Fri, 5 May 2017 11:11:50 +0000 (11:11 +0000)
committerPablo Neira Ayuso <pablo@gnumonks.org>
Mon, 8 May 2017 18:01:38 +0000 (20:01 +0200)
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>
libxtables/xtables.c

index 891d81a7fb0dd6d859c06741385c0948b34599ee..57a11022ab6c8c70a01791da39f6b54d27aa76d4 100644 (file)
@@ -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;
                }
        }
 }