From: Ozgur AKAN Date: Wed, 7 Apr 2004 09:36:29 +0000 (+0000) Subject: fix case where somebody uses '-i +' as interface name (Ozgur AKAN) X-Git-Tag: v1.3.0-rc1~111 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=3610deb41015dcdbbe6b684fe7ae6e0f9e37eff4;p=thirdparty%2Fiptables.git fix case where somebody uses '-i +' as interface name (Ozgur AKAN) --- diff --git a/ip6tables.c b/ip6tables.c index 138eed91..9e9a5290 100644 --- a/ip6tables.c +++ b/ip6tables.c @@ -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); diff --git a/iptables.c b/iptables.c index ae6538c0..4b0fe6c1 100644 --- a/iptables.c +++ b/iptables.c @@ -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);