netfilter-devel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Oliver Ford <ojford@gmail.com>
To: netfilter-devel@vger.kernel.org
Cc: Oliver Ford <ojford@gmail.com>
Subject: [PATCH 1/1] libxtables: Display weird character warning for wildcards
Date: Fri,  5 May 2017 11:11:50 +0000	[thread overview]
Message-ID: <1493982710-10847-1-git-send-email-ojford@gmail.com> (raw)

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>
---
 libxtables/xtables.c | 18 +++++++++---------
 1 file changed, 9 insertions(+), 9 deletions(-)

diff --git a/libxtables/xtables.c b/libxtables/xtables.c
index 891d81a..57a1102 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;
 		}
 	}
 }
-- 
2.11.0



             reply	other threads:[~2017-05-05 11:12 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2017-05-05 11:11 Oliver Ford [this message]
2017-05-08 18:02 ` [PATCH 1/1] libxtables: Display weird character warning for wildcards Pablo Neira Ayuso

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=1493982710-10847-1-git-send-email-ojford@gmail.com \
    --to=ojford@gmail.com \
    --cc=netfilter-devel@vger.kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).