summaryrefslogtreecommitdiffstats
path: root/iptables/xtables.c
diff options
context:
space:
mode:
authorRichard Weinberger <richard@nod.at>2011-08-27 15:32:31 +0200
committerJan Engelhardt <jengelh@medozas.de>2011-08-27 18:36:19 +0200
commit2ca6273c73b42e8c74afd5f8b1fe10c5c93ce363 (patch)
treea6ab73b84fbfacb95b213a0d959c43c1f99be3f7 /iptables/xtables.c
parent3412bd0bfb8b8bac9834cbfd3392b3d5487133bf (diff)
xtoptions: simplify xtables_parse_interface
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>
Diffstat (limited to 'iptables/xtables.c')
-rw-r--r--iptables/xtables.c4
1 files changed, 1 insertions, 3 deletions
diff --git a/iptables/xtables.c b/iptables/xtables.c
index 233efa30..e72aa284 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] == ' ') {