]> git.ipfire.org Git - thirdparty/iptables.git/commitdiff
xtoptions: simplify xtables_parse_interface
authorRichard Weinberger <richard@nod.at>
Sat, 27 Aug 2011 13:32:31 +0000 (15:32 +0200)
committerJan Engelhardt <jengelh@medozas.de>
Sat, 27 Aug 2011 16:36:19 +0000 (18:36 +0200)
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

index 233efa304b9f8656fbe8febfd971d08610cb8a91..e72aa2844ce48f0f5dc144c81b9b240d5b488971 100644 (file)
@@ -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] == ' ') {