Received: by 2002:a05:6a10:d5a5:0:0:0:0 with SMTP id gn37csp3989473pxb; Mon, 4 Oct 2021 14:34:21 -0700 (PDT) X-Google-Smtp-Source: ABdhPJzIPCZxhjW5bZ4AgFIm7AoLIOMWTFDVRlQJdrejrYWLsg2OKo5dV7RTxvkqqX9et8C0lEvB X-Received: by 2002:a50:fc97:: with SMTP id f23mr21078269edq.176.1633383261671; Mon, 04 Oct 2021 14:34:21 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1633383261; cv=none; d=google.com; s=arc-20160816; b=f/gQzoqG0RD1ZT1Kgwfl0+BCVPyjE8Yyb0vby8gV3z3z8whokV58oBNS7P88BPclSl C5UJ8DnydIGlhLRhHNruWos71frDe9QqzkWrADzFAUSmm8XD1vxLVgDH8BwR4QbE2qTz 0deGlmtL7oBb4+DumZHXYnPvQkFSQv/MzMiuPklxw6hocOqgDMFriGoEKcTKjghbaNSg 7P02nTVfs3pBlWWbcEW768DwoAM7UOdoYxuWjMOrQxZZLfJER6XjFkQ172n6nPnYUlNA HGRQzugFzYKgflbq0N0KLvZRf2Q5p9DImnIVyc4ZFUOipAYKYhbCR97e0SNWn2LHSNXT Ip6Q== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :user-agent:references:in-reply-to:message-id:date:subject:cc:to :from:dkim-signature; bh=F/Yl4sD2mxnjwPPtRajJFMorpiHnx+VI0vKXZmMsiuo=; b=wuX+zo3G5X7m7jKp363PtG49eRSYBxG4bUICDA4K1SjYahh3BpA4zr58gWBsPvlwI6 AxilAdr/10JWeHJF9bYIDav5fE7D+9Ad5QPESkBnjuaPIBQX8B5Kie87dYYfek/8Bdm7 XZ8C1STtpeibVZGLvttkSYwOh3Y1wt5ri2BPKSP/HO0p2V4FwTliEkBSjo2JjAPBGMcJ lo2rMBIGH1ciBGwegwQCdl0X91BWJvOH9ch0J5KkiOTwnHaDC0DvIx1F5FrJJczgxKRM MNtOEJmlsXzo6st4tM4jr5Hd5shLUK2BtCQRT8ZENMB/Md94vnGzgfLiVAOlB87DJgfo LeyA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=lN3IUjpP; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linuxfoundation.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id bl4si6733853ejb.277.2021.10.04.14.33.57; Mon, 04 Oct 2021 14:34:21 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=lN3IUjpP; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linuxfoundation.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S237622AbhJDNjE (ORCPT + 99 others); Mon, 4 Oct 2021 09:39:04 -0400 Received: from mail.kernel.org ([198.145.29.99]:51998 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S238160AbhJDNhJ (ORCPT ); Mon, 4 Oct 2021 09:37:09 -0400 Received: by mail.kernel.org (Postfix) with ESMTPSA id 6AAFC6126A; Mon, 4 Oct 2021 13:16:50 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1633353410; bh=qJ9lhhn04jBi8L3e0Q5wmv8IRUQA0TvXcJUX+Ff7azk=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=lN3IUjpPF0NQp0Pv0J2YwhZ2CKdys8uFU40qGHmtLBDAji81xsl3fKipzrgPCq6/R qTh0F4zpbqFqUD28jqFPFmGWUG65ek27UHPM7la4Ji7K/LXabuIFTrkO3m0RLz9f3f HodXqAEVNqFrrEutzj/kzKFkW9PZ8IP9B4Dhfuxk= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Jiri Benc , Daniel Borkmann , Sasha Levin Subject: [PATCH 5.14 117/172] selftests, bpf: test_lwt_ip_encap: Really disable rp_filter Date: Mon, 4 Oct 2021 14:52:47 +0200 Message-Id: <20211004125048.759890007@linuxfoundation.org> X-Mailer: git-send-email 2.33.0 In-Reply-To: <20211004125044.945314266@linuxfoundation.org> References: <20211004125044.945314266@linuxfoundation.org> User-Agent: quilt/0.66 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org From: Jiri Benc [ Upstream commit 79e2c306667542b8ee2d9a9d947eadc7039f0a3c ] It's not enough to set net.ipv4.conf.all.rp_filter=0, that does not override a greater rp_filter value on the individual interfaces. We also need to set net.ipv4.conf.default.rp_filter=0 before creating the interfaces. That way, they'll also get their own rp_filter value of zero. Fixes: 0fde56e4385b0 ("selftests: bpf: add test_lwt_ip_encap selftest") Signed-off-by: Jiri Benc Signed-off-by: Daniel Borkmann Link: https://lore.kernel.org/bpf/b1cdd9d469f09ea6e01e9c89a6071c79b7380f89.1632386362.git.jbenc@redhat.com Signed-off-by: Sasha Levin --- tools/testing/selftests/bpf/test_lwt_ip_encap.sh | 13 ++++++++----- 1 file changed, 8 insertions(+), 5 deletions(-) diff --git a/tools/testing/selftests/bpf/test_lwt_ip_encap.sh b/tools/testing/selftests/bpf/test_lwt_ip_encap.sh index 59ea56945e6c..b497bb85b667 100755 --- a/tools/testing/selftests/bpf/test_lwt_ip_encap.sh +++ b/tools/testing/selftests/bpf/test_lwt_ip_encap.sh @@ -112,6 +112,14 @@ setup() ip netns add "${NS2}" ip netns add "${NS3}" + # rp_filter gets confused by what these tests are doing, so disable it + ip netns exec ${NS1} sysctl -wq net.ipv4.conf.all.rp_filter=0 + ip netns exec ${NS2} sysctl -wq net.ipv4.conf.all.rp_filter=0 + ip netns exec ${NS3} sysctl -wq net.ipv4.conf.all.rp_filter=0 + ip netns exec ${NS1} sysctl -wq net.ipv4.conf.default.rp_filter=0 + ip netns exec ${NS2} sysctl -wq net.ipv4.conf.default.rp_filter=0 + ip netns exec ${NS3} sysctl -wq net.ipv4.conf.default.rp_filter=0 + ip link add veth1 type veth peer name veth2 ip link add veth3 type veth peer name veth4 ip link add veth5 type veth peer name veth6 @@ -236,11 +244,6 @@ setup() ip -netns ${NS1} -6 route add ${IPv6_GRE}/128 dev veth5 via ${IPv6_6} ${VRF} ip -netns ${NS2} -6 route add ${IPv6_GRE}/128 dev veth7 via ${IPv6_8} ${VRF} - # rp_filter gets confused by what these tests are doing, so disable it - ip netns exec ${NS1} sysctl -wq net.ipv4.conf.all.rp_filter=0 - ip netns exec ${NS2} sysctl -wq net.ipv4.conf.all.rp_filter=0 - ip netns exec ${NS3} sysctl -wq net.ipv4.conf.all.rp_filter=0 - TMPFILE=$(mktemp /tmp/test_lwt_ip_encap.XXXXXX) sleep 1 # reduce flakiness -- 2.33.0