From: Jun Zhao <mypopydev@gmail.com>
To: "David S. Miller" <davem@davemloft.net>,
Alexey Kuznetsov <kuznet@ms2.inr.ac.ru>,
James Morris <jmorris@namei.org>,
Hideaki YOSHIFUJI <yoshfuji@linux-ipv6.org>,
netdev@vger.kernel.org
Cc: mypopydev@gmail.com
Subject: [PATCH 1/1] ipv6 : ip6mr.c : Fix can't match the IPv6 multicast packets with input net device in netfilter FORWARD chain.
Date: Thu, 2 Aug 2012 21:00:55 +0800 [thread overview]
Message-ID: <1343912455-4444-1-git-send-email-mypopydev@gmail.com> (raw)
Current kernel change the skb's net device with output device before netfilter FORWARD chain,
that will lead to can't match the IPv6 multicast packets with input net device in netfilter
FORWARD chain.
the test case for reproduce this issue as follow:
IPv6 multicast udp stream from eth0(input device) to eth1(output device)
Dst Addr: Port
{ff03::4}:6789 --->
Router
+---------------------------+
-------> | [eth0] --FORWARD--> [eth1]| ------->
+---------------------------+
ip6tables -I FORWARD -p udp -i eth0 -o eth1 --dst ff03::4 -j ACCEPT [first rules ]
ip6tables -A FORWARD -p udp -i eth1 -o eth1 --dst ff03::4 -j ACCEPT [second rules]
Before fix this issue, it will match the second rules not the first rules. you can used
command "ip6tables -L -vnx" to check the match result.
Signed-off-by: Jun Zhao <mypopydev@gmail.com>
---
net/ipv6/ip6mr.c | 2 +-
1 files changed, 1 insertions(+), 1 deletions(-)
diff --git a/net/ipv6/ip6mr.c b/net/ipv6/ip6mr.c
index 4532973..a9d3dd7 100644
--- a/net/ipv6/ip6mr.c
+++ b/net/ipv6/ip6mr.c
@@ -1946,7 +1946,7 @@ static int ip6mr_forward2(struct net *net, struct mr6_table *mrt,
* result in receiving multiple packets.
*/
dev = vif->dev;
- skb->dev = dev;
+
vif->pkt_out++;
vif->bytes_out += skb->len;
--
1.7.2.5
next reply other threads:[~2012-08-02 13:01 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2012-08-02 13:00 Jun Zhao [this message]
2012-08-02 23:20 ` [PATCH 1/1] ipv6 : ip6mr.c : Fix can't match the IPv6 multicast packets with input net device in netfilter FORWARD chain David Miller
2012-08-03 6:10 ` Jun Zhao
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=1343912455-4444-1-git-send-email-mypopydev@gmail.com \
--to=mypopydev@gmail.com \
--cc=davem@davemloft.net \
--cc=jmorris@namei.org \
--cc=kuznet@ms2.inr.ac.ru \
--cc=netdev@vger.kernel.org \
--cc=yoshfuji@linux-ipv6.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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).