[PATCH 1/1] ipv6 : ip6mr.c : Fix can't match the IPv6 multicast packets with input net device in netfilter FORWARD chain.

Subsystems: networking [general], networking [ipv4/ipv6], the rest

STALE5143d

3 messages, 2 authors, 2012-08-03 · open the first message on its own page

[PATCH 1/1] ipv6 : ip6mr.c : Fix can't match the IPv6 multicast packets with input net device in netfilter FORWARD chain.

From: Jun Zhao <hidden>
Date: 2012-08-02 13:01:28

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 <redacted>
---
 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

Re: [PATCH 1/1] ipv6 : ip6mr.c : Fix can't match the IPv6 multicast packets with input net device in netfilter FORWARD chain.

From: David Miller <davem@davemloft.net>
Date: 2012-08-02 23:20:16

From: Jun Zhao <redacted>
Date: Thu,  2 Aug 2012 21:00:55 +0800
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)
Your change means we now can't match on the VIF device in this situation.

I'm not applying this patch, it breaks as much as it fixes.

Re: [PATCH 1/1] ipv6 : ip6mr.c : Fix can't match the IPv6 multicast packets with input net device in netfilter FORWARD chain.

From: Jun Zhao <hidden>
Date: 2012-08-03 06:10:51

On Thu, 2012-08-02 at 16:20 -0700, David Miller wrote:
From: Jun Zhao <redacted>
Date: Thu,  2 Aug 2012 21:00:55 +0800
quoted
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)
Your change means we now can't match on the VIF device in this situation.

I'm not applying this patch, it breaks as much as it fixes.
Hi, David:

Maybe I need to used conservative approach to fix it and don't breaks
much more, I will supply the version 2 patch for this issue.

Tks.
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help