From patchwork Thu Sep 22 04:13:08 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Mark Tomlinson X-Patchwork-Id: 673123 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 3sfjnw4m35z9s36 for ; Thu, 22 Sep 2016 14:15:16 +1000 (AEST) Authentication-Results: ozlabs.org; dkim=pass (1024-bit key; unprotected) header.d=alliedtelesis.co.nz header.i=@alliedtelesis.co.nz header.b=fWtSKW06; dkim-atps=neutral Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751299AbcIVENq (ORCPT ); Thu, 22 Sep 2016 00:13:46 -0400 Received: from gate2.alliedtelesis.co.nz ([202.36.163.20]:47427 "EHLO gate2.alliedtelesis.co.nz" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1750847AbcIVENp (ORCPT ); Thu, 22 Sep 2016 00:13:45 -0400 Received: from mmarshal3.atlnz.lc (mmarshal3.atlnz.lc [10.32.18.43]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by gate2.alliedtelesis.co.nz (Postfix) with ESMTPS id A695786053; Thu, 22 Sep 2016 16:13:40 +1200 (NZST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=alliedtelesis.co.nz; s=mail; t=1474517620; bh=rLzFev0Z/Ntq9jyvqHdwl/9WPKKEaRYVatkocfD0Jp0=; h=From:To:Cc:Subject:Date; b=fWtSKW06XSjxpPxtzmD4xe06P3f7lakT3WHg+91a8sABXYj7N+Ni1xLXfx2pUD5j3 mc8yPpVTCsVZk5c7n+KbRhmQkAm3Fx01lgQGu+pmIM05bF+ssyyX7b2TrJLA1bCtjl ASFGexP4jB+2rON4+yVQqJG0MykCNnFhz5+D9XOk= Received: from smtp (Not Verified[10.32.16.33]) by mmarshal3.atlnz.lc with Trustwave SEG (v7, 3, 6, 7949) id ; Thu, 22 Sep 2016 16:13:40 +1200 Received: from markto-dl.ws.atlnz.lc (markto-dl.ws.atlnz.lc [10.33.23.36]) by smtp (Postfix) with ESMTP id F287713EF09; Thu, 22 Sep 2016 16:13:39 +1200 (NZST) Received: by markto-dl.ws.atlnz.lc (Postfix, from userid 1155) id 5086E2FEE20; Thu, 22 Sep 2016 16:13:40 +1200 (NZST) From: Mark Tomlinson To: netdev@vger.kernel.org, dsa@cumulusnetworks.com Cc: Mark Tomlinson Subject: [PATCH] net: VRF: Fix receiving multicast traffic Date: Thu, 22 Sep 2016 16:13:08 +1200 Message-Id: <20160922041308.30848-1-mark.tomlinson@alliedtelesis.co.nz> X-Mailer: git-send-email 2.9.3 Sender: netdev-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: netdev@vger.kernel.org The previous patch to ensure that the original iif was used when checking for forwarding also meant that this same interface was used to determine whether multicast packets should be received or not. This was incorrect, and would cause multicast packets to be dropped. The fix here is to use skb->dev when checking multicast addresses. skb->dev has been set to the l3mdev by this point, so the check will be against that, rather than the ingress interface. Fixes: "net:VRF: Pass original iif to ip_route_input()" Signed-off-by: Mark Tomlinson --- net/ipv4/route.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/net/ipv4/route.c b/net/ipv4/route.c index a1f2830..75e1de6 100644 --- a/net/ipv4/route.c +++ b/net/ipv4/route.c @@ -1971,7 +1971,7 @@ int ip_route_input_noref(struct sk_buff *skb, __be32 daddr, __be32 saddr, route cache entry is created eventually. */ if (ipv4_is_multicast(daddr)) { - struct in_device *in_dev = __in_dev_get_rcu(dev); + struct in_device *in_dev = __in_dev_get_rcu(skb->dev); if (in_dev) { int our = ip_check_mc_rcu(in_dev, daddr, saddr,