From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-10.1 required=3.0 tests=DKIMWL_WL_HIGH,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,INCLUDES_PATCH,MAILING_LIST_MULTI,SIGNED_OFF_BY, SPF_HELO_NONE,SPF_PASS,USER_AGENT_GIT autolearn=unavailable autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 53312C433E6 for ; Mon, 29 Jun 2020 19:02:36 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id 2B8BA2067D for ; Mon, 29 Jun 2020 19:02:36 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1593457356; bh=f1vPHzNtr1Vmjka+F3U37oEz28VDM9kM8QKZ4JjCEiE=; h=From:To:Cc:Subject:Date:In-Reply-To:References:List-ID:From; b=dbWdjOGuj/BoxeOUAYz684XKDorjcj/mYz7YZcubsorGakbFlFvAKM5JW+JrL+/SC h5mf6+dd6QI9LJlHULK5FYSt1Lnov50rOMvrgcBnJqZ090c5U1oraxfsDH1Zv/H9DF Pg2HmHMgbaIBrjhSUXem3ouIh3TS7/SE7Rm+E4IM= Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1729414AbgF2TCE (ORCPT ); Mon, 29 Jun 2020 15:02:04 -0400 Received: from mail.kernel.org ([198.145.29.99]:45486 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1730357AbgF2TAV (ORCPT ); Mon, 29 Jun 2020 15:00:21 -0400 Received: from sasha-vm.mshome.net (c-73-47-72-35.hsd1.nh.comcast.net [73.47.72.35]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPSA id 8AFB325531; Mon, 29 Jun 2020 15:54:56 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1593446097; bh=f1vPHzNtr1Vmjka+F3U37oEz28VDM9kM8QKZ4JjCEiE=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=Cb8bXa4h/7batwTZy7IQXcu/if12cvWBi+q7xS/51WDxbvOeJ2zTt7ExZNlEUcCrL 2a0WUPXc880svd4xz+PDBE94WVT/BbxRLdGL+qeq6RRfPPmiTGguUtprmgOzWOjORo oRlBrSZh55F2cOzavYCM5rtECTRG40Vm7zRkvpzE= From: Sasha Levin To: linux-kernel@vger.kernel.org, stable@vger.kernel.org Cc: guodeqing , David Ahern , "David S . Miller" , Greg Kroah-Hartman Subject: [PATCH 4.4 090/135] net: Fix the arp error in some cases Date: Mon, 29 Jun 2020 11:52:24 -0400 Message-Id: <20200629155309.2495516-91-sashal@kernel.org> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20200629155309.2495516-1-sashal@kernel.org> References: <20200629155309.2495516-1-sashal@kernel.org> MIME-Version: 1.0 X-KernelTest-Patch: http://kernel.org/pub/linux/kernel/v4.x/stable-review/patch-4.4.229-rc1.gz X-KernelTest-Tree: git://git.kernel.org/pub/scm/linux/kernel/git/stable/linux-stable-rc.git X-KernelTest-Branch: linux-4.4.y X-KernelTest-Patches: git://git.kernel.org/pub/scm/linux/kernel/git/stable/stable-queue.git X-KernelTest-Version: 4.4.229-rc1 X-KernelTest-Deadline: 2020-07-01T15:53+00:00 X-stable: review X-Patchwork-Hint: Ignore Content-Transfer-Encoding: 8bit Sender: stable-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: stable@vger.kernel.org From: guodeqing [ Upstream commit 5eea3a63ff4aba6a26002e657a6d21934b7e2b96 ] ie., $ ifconfig eth0 6.6.6.6 netmask 255.255.255.0 $ ip rule add from 6.6.6.6 table 6666 $ ip route add 9.9.9.9 via 6.6.6.6 $ ping -I 6.6.6.6 9.9.9.9 PING 9.9.9.9 (9.9.9.9) from 6.6.6.6 : 56(84) bytes of data. 3 packets transmitted, 0 received, 100% packet loss, time 2079ms $ arp Address HWtype HWaddress Flags Mask Iface 6.6.6.6 (incomplete) eth0 The arp request address is error, this is because fib_table_lookup in fib_check_nh lookup the destnation 9.9.9.9 nexthop, the scope of the fib result is RT_SCOPE_LINK,the correct scope is RT_SCOPE_HOST. Here I add a check of whether this is RT_TABLE_MAIN to solve this problem. Fixes: 3bfd847203c6 ("net: Use passed in table for nexthop lookups") Signed-off-by: guodeqing Reviewed-by: David Ahern Signed-off-by: David S. Miller Signed-off-by: Greg Kroah-Hartman --- net/ipv4/fib_semantics.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/net/ipv4/fib_semantics.c b/net/ipv4/fib_semantics.c index 498d5a929d6f2..3c1e42d495201 100644 --- a/net/ipv4/fib_semantics.c +++ b/net/ipv4/fib_semantics.c @@ -776,7 +776,7 @@ static int fib_check_nh(struct fib_config *cfg, struct fib_info *fi, if (fl4.flowi4_scope < RT_SCOPE_LINK) fl4.flowi4_scope = RT_SCOPE_LINK; - if (cfg->fc_table) + if (cfg->fc_table && cfg->fc_table != RT_TABLE_MAIN) tbl = fib_get_table(net, cfg->fc_table); if (tbl) -- 2.25.1