Skip to contentSkip to conversation

libxtables: Display weird character warning for wildcards

PATCH Applied Oliver Ford 2 participants 2 messages May 5, 2017 – May 8, 2017 netfilter

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 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.

---
 libxtables/xtables.c | 18 +++++++++---------
 1 file changed, 9 insertions(+), 9 deletions(-)
libxtables/xtables.c +9 -9
index 891d81a..57a1102 100644
@@ -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;
 		}
 	}
 }
Signature · 1 line
2.11.0
maintainer Applied
#1 lore raw
Quoted 5 lines · Oliver Ford

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.

Applied, thanks.