From patchwork Thu Aug 2 13:00:55 2012 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Jun Zhao X-Patchwork-Id: 174751 X-Patchwork-Delegate: davem@davemloft.net Return-Path: X-Original-To: patchwork-incoming@ozlabs.org Delivered-To: patchwork-incoming@ozlabs.org Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by ozlabs.org (Postfix) with ESMTP id 113322C0091 for ; Thu, 2 Aug 2012 23:01:31 +1000 (EST) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751832Ab2HBNB3 (ORCPT ); Thu, 2 Aug 2012 09:01:29 -0400 Received: from mail-gh0-f174.google.com ([209.85.160.174]:57994 "EHLO mail-gh0-f174.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751710Ab2HBNB2 (ORCPT ); Thu, 2 Aug 2012 09:01:28 -0400 Received: by ghrr11 with SMTP id r11so2196295ghr.19 for ; Thu, 02 Aug 2012 06:01:27 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=from:to:cc:subject:date:message-id:x-mailer; bh=tGOB16s4w8QQZkSEI+IhN5Rq/tuVfnLsLRfFxuMKnt4=; b=kHZ+qWuRPnFrBuzbybFG6sx5kQjLvgxJprL+SoT7DrM8sE2q7UTpbZuJPWZa9xjfwW paelC0tH3IIlRdB9b5vwDhqO5IU4a0uSKH9Ub9ZZ18dElLY3CuwZKtfbgx7UPbnbnmTv hPghqimKjy9yTMlb0r9b6dWi00EACZYyYcX5cyr6/ImogbpoYuWZFi/Y/UlzWct1glTu Oc/kk5DHDH6JwSOADhF7BZ6qwuHT+9tUKA2x12hDJECbNzAV7h7On9+PDx4G6Cdfk6Sn GCbPray3JAKUacoLw9kECGtqGgf0HRqMUxIMIKHJuMQal9hT2vJ3MHVEqg0VF7YD7xWB fcZg== Received: by 10.50.135.74 with SMTP id pq10mr3581192igb.29.1343912486258; Thu, 02 Aug 2012 06:01:26 -0700 (PDT) Received: from localhost.localdomain ([60.63.199.50]) by mx.google.com with ESMTPS id bo7sm13197626igb.2.2012.08.02.06.01.22 (version=TLSv1/SSLv3 cipher=OTHER); Thu, 02 Aug 2012 06:01:25 -0700 (PDT) From: Jun Zhao To: "David S. Miller" , Alexey Kuznetsov , James Morris , Hideaki YOSHIFUJI , 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 Message-Id: <1343912455-4444-1-git-send-email-mypopydev@gmail.com> X-Mailer: git-send-email 1.7.2.5 Sender: netdev-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: netdev@vger.kernel.org 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 --- 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;