From: Ozgur AKAN <akan@aiqa.com>
To: netfilter-devel@lists.netfilter.org
Cc: Harald Welte <laforge@netfilter.org>
Subject: plus sign as interface value bug
Date: Mon, 05 Apr 2004 16:44:04 +0300 [thread overview]
Message-ID: <407162A4.3050901@aiqa.com> (raw)
[-- 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);
next reply other threads:[~2004-04-05 13:44 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
2004-04-05 13:44 Ozgur AKAN [this message]
2004-04-07 9:26 ` plus sign as interface value bug Harald Welte
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=407162A4.3050901@aiqa.com \
--to=akan@aiqa.com \
--cc=laforge@netfilter.org \
--cc=netfilter-devel@lists.netfilter.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
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.