From f4495808c96ed20f9af78f81f881a5d8b11eac98 Mon Sep 17 00:00:00 2001 From: laforge Date: Wed, 7 Apr 2004 09:36:29 +0000 Subject: fix case where somebody uses '-i +' as interface name (Ozgur AKAN) --- ip6tables.c | 2 +- iptables.c | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/ip6tables.c b/ip6tables.c index 138eed9..9e9a529 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 ae6538c..4b0fe6c 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); -- cgit v1.2.3