From: Jan Engelhardt <jengelh@medozas.de>
To: kaber@trash.net
Cc: netfilter-devel@vger.kernel.org
Subject: [PATCH 3/3] xtoptions: simplify xtables_parse_interface
Date: Thu, 1 Sep 2011 11:15:50 +0200 [thread overview]
Message-ID: <1314868551-4281-4-git-send-email-jengelh@medozas.de> (raw)
In-Reply-To: <1314868551-4281-1-git-send-email-jengelh@medozas.de>
From: Richard Weinberger <richard@nod.at>
mask is already filled with zeros, there is no need to zero it again.
References: http://marc.info/?l=netfilter-devel&m=131445196526269&w=2
Signed-off-by: Jan Engelhardt <jengelh@medozas.de>
---
iptables/xtables.c | 4 +---
1 files changed, 1 insertions(+), 3 deletions(-)
diff --git a/iptables/xtables.c b/iptables/xtables.c
index 233efa3..e72aa28 100644
--- a/iptables/xtables.c
+++ b/iptables/xtables.c
@@ -515,15 +515,13 @@ void xtables_parse_interface(const char *arg, char *vianame,
strcpy(vianame, arg);
if (vialen == 0)
- memset(mask, 0, IFNAMSIZ);
+ return;
else if (vianame[vialen - 1] == '+') {
memset(mask, 0xFF, vialen - 1);
- memset(mask + vialen - 1, 0, IFNAMSIZ - vialen + 1);
/* Don't remove `+' here! -HW */
} else {
/* Include nul-terminator in match */
memset(mask, 0xFF, vialen + 1);
- memset(mask + vialen + 1, 0, IFNAMSIZ - vialen - 1);
for (i = 0; vianame[i]; i++) {
if (vianame[i] == '/' ||
vianame[i] == ' ') {
--
1.7.3.4
prev parent reply other threads:[~2011-09-01 9:15 UTC|newest]
Thread overview: 4+ messages / expand[flat|nested] mbox.gz Atom feed top
2011-09-01 9:15 iptables fixes 20110901 Jan Engelhardt
2011-09-01 9:15 ` [PATCH 1/3] xtoptions: fill in fallback value for nvals Jan Engelhardt
2011-09-01 9:15 ` [PATCH 2/3] libxt_conntrack: improve error message on parsing violation Jan Engelhardt
2011-09-01 9:15 ` Jan Engelhardt [this message]
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=1314868551-4281-4-git-send-email-jengelh@medozas.de \
--to=jengelh@medozas.de \
--cc=kaber@trash.net \
--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).