* plus sign as interface value bug
@ 2004-04-05 13:44 Ozgur AKAN
2004-04-07 9:26 ` Harald Welte
0 siblings, 1 reply; 2+ messages in thread
From: Ozgur AKAN @ 2004-04-05 13:44 UTC (permalink / raw)
To: netfilter-devel; +Cc: Harald Welte
[-- Attachment #1.1: Type: text/plain, Size: 608 bytes --]
Hi,
I found a minor bug in iptables.c. Assuming that;
iptables -A INPUT -i + -j ACCEPT == iptables -A INPUT -j ACCEPT
giving "+" as interface value is same as giving no interface value. But
the output of "iptables -nvL" is "+" as interface value for "-i +". If
no interface value is given "iptables -nvL" prints "*". (Also
iptables-save ignores single "+" as interface value, as normally it should)
This can be fixed by changing "if (vialen == 0)" in iptables.c
"if ( (vialen == 0) || (vialen == 1 && vianame[0] == '+') )"
I attached the patches for iptables.c and ip6tables.c.
regards,
Ozgur AKAN
[-- Attachment #1.2: Type: text/html, Size: 958 bytes --]
[-- Attachment #2: plus_sign_ip6tables.PATCH --]
[-- Type: text/plain, Size: 441 bytes --]
--- cvs/iptables/ip6tables.c 2004-02-02 22:02:10.000000000 +0200
+++ cvs/iptables_dev/ip6tables.c 2004-04-05 16:29:50.549995824 +0300
@@ -840,7 +840,7 @@ parse_interface(const char *arg, char *v
" (%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);
[-- Attachment #3: plus_sign_iptables.PATCH --]
[-- Type: text/plain, Size: 439 bytes --]
--- cvs/iptables/iptables.c 2004-02-21 11:20:34.000000000 +0200
+++ cvs/iptables_dev/iptables.c 2004-04-05 16:29:33.256624816 +0300
@@ -780,7 +780,7 @@ parse_interface(const char *arg, char *v
" (%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);
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2004-04-07 9:26 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2004-04-05 13:44 plus sign as interface value bug Ozgur AKAN
2004-04-07 9:26 ` Harald Welte
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.