netfilter-devel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH 1/1] libxtables: Display weird character warning for wildcards
@ 2017-05-05 11:11 Oliver Ford
  2017-05-08 18:02 ` Pablo Neira Ayuso
  0 siblings, 1 reply; 2+ messages in thread
From: Oliver Ford @ 2017-05-05 11:11 UTC (permalink / raw)
  To: netfilter-devel; +Cc: 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.

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



^ permalink raw reply related	[flat|nested] 2+ messages in thread

* Re: [PATCH 1/1] libxtables: Display weird character warning for wildcards
  2017-05-05 11:11 [PATCH 1/1] libxtables: Display weird character warning for wildcards Oliver Ford
@ 2017-05-08 18:02 ` Pablo Neira Ayuso
  0 siblings, 0 replies; 2+ messages in thread
From: Pablo Neira Ayuso @ 2017-05-08 18:02 UTC (permalink / raw)
  To: Oliver Ford; +Cc: netfilter-devel

On Fri, May 05, 2017 at 11:11:50AM +0000, Oliver Ford wrote:
> 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.

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2017-05-08 18:02 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2017-05-05 11:11 [PATCH 1/1] libxtables: Display weird character warning for wildcards Oliver Ford
2017-05-08 18:02 ` Pablo Neira Ayuso

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).