]> git.ipfire.org Git - thirdparty/iptables.git/commitdiff
fix case where somebody uses '-i +' as interface name (Ozgur AKAN)
authorOzgur AKAN <akan@aiqa.com>
Wed, 7 Apr 2004 09:36:29 +0000 (09:36 +0000)
committerHarald Welte <laforge@gnumonks.org>
Wed, 7 Apr 2004 09:36:29 +0000 (09:36 +0000)
ip6tables.c
iptables.c

index 138eed9142903cfbffe55a9fe995204591a8058f..9e9a5290a4e66d73889e1eb490ec8bf065a90b23 100644 (file)
@@ -840,7 +840,7 @@ parse_interface(const char *arg, char *vianame, unsigned char *mask)
                           " (%i)", arg, IFNAMSIZ-1);
 
        strcpy(vianame, arg);
-       if (vialen == 0)
+       if ((vialen == 0) || (vialen == 1 && vianame[0] == '+'))
                memset(mask, 0, IFNAMSIZ);
        else if (vianame[vialen - 1] == '+') {
                memset(mask, 0xFF, vialen - 1);
index ae6538c049437c3880a089e360286246fb37df3b..4b0fe6c1e0a16be3bdc23c3894143dd1c848ec29 100644 (file)
@@ -780,7 +780,7 @@ parse_interface(const char *arg, char *vianame, unsigned char *mask)
                           " (%i)", arg, IFNAMSIZ-1);
 
        strcpy(vianame, arg);
-       if (vialen == 0)
+       if ((vialen == 0) || (vialen == 1 && vianame[0] == '+'))
                memset(mask, 0, IFNAMSIZ);
        else if (vianame[vialen - 1] == '+') {
                memset(mask, 0xFF, vialen - 1);