Received: by 2002:a05:6358:9144:b0:117:f937:c515 with SMTP id r4csp423108rwr; Thu, 27 Apr 2023 03:24:11 -0700 (PDT) X-Google-Smtp-Source: ACHHUZ7YfffJ1BhfgvRgSTRzoXdNrXocy9u+AsQ9sDpqltWwSWjId7mbvr8CQgP3FJC7e1dZI7RY X-Received: by 2002:a17:903:244b:b0:1a6:5f92:3ba with SMTP id l11-20020a170903244b00b001a65f9203bamr1294281pls.0.1682591050953; Thu, 27 Apr 2023 03:24:10 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1682591050; cv=none; d=google.com; s=arc-20160816; b=FK9RLQy+zwQev7TSEFIV0KfVlij/UWTqF14Ms8PvluFOvuAkoPxYcKbHqsOCvfcsr5 ckfh6MyknosMuhstm2jXlERNICb6ZWS9cfobed5M8l1I5OWqTXN1SW8dnfSbJauccmud i+/Yte4m7uuGZxl+lS8jJWS+mqBz3S05z0T2cPl7o/EB9QkYT87ULpoHoliV0BcCMSrt NHESoKU9ymqeR+hrcuQUQFajZMCD5SJSyyFEu1beSZg5XD5OjTP558Vn/LA7f0JYBcyt BOTIntEkoQV0C4kOyje0kPBPt1OgMKjJAvBkuhZiHLXCKWWCOj+Yx2DMONsq6iKF2Ybp G8/g== 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 :message-id:date:subject:cc:to:from; bh=SQJx3TYKx0LS3XOCdm466OqdsRJRS0aiqAgrk9ll4to=; b=Ujc82SQUo4ne2bZm9nGgR+zZcm+b2iVE9z1O/fp0qave98TWKohss9L2fbsRchfM/m 3YRGhF2vn15XtU48S6aFzGMUlUhmN8sRONxKYerpJuITx2WDhxCAZw3iwNrb769OKBl8 OgsNO8PwV0P89pWnNVQMUrJn/sLtppdZdme1gN/6ImwHWKIg4JNU/iBk6EEAC6Dq8g8X FMT94mhXlbg5j1RFvq5AV9dWWoHYMRWQPhU9NIfZs/0Nk4B1fBRnuAuO7z1c5jxSLLFJ v5uU2npmj9wcWdgLD/aLrnT9AFwBNqBoGu1lBn2bozFWNUiFU6DDcvquC7n7YEw20smK qxCA== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=uniroma2.it Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id b21-20020a170902d41500b001a66afd1fcfsi17279910ple.651.2023.04.27.03.23.57; Thu, 27 Apr 2023 03:24:10 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=uniroma2.it Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S243505AbjD0KWW (ORCPT + 99 others); Thu, 27 Apr 2023 06:22:22 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:54860 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S243577AbjD0KWA (ORCPT ); Thu, 27 Apr 2023 06:22:00 -0400 X-Greylist: delayed 569 seconds by postgrey-1.37 at lindbergh.monkeyblade.net; Thu, 27 Apr 2023 03:21:43 PDT Received: from smtp.uniroma2.it (smtp.uniroma2.it [160.80.6.16]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 5EE2259F8; Thu, 27 Apr 2023 03:21:43 -0700 (PDT) Received: from localhost.localdomain ([160.80.103.126]) by smtp-2015.uniroma2.it (8.14.4/8.14.4/Debian-8) with ESMTP id 33R9naub002272 (version=TLSv1/SSLv3 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128 verify=NOT); Thu, 27 Apr 2023 11:49:36 +0200 From: Andrea Mayer To: "David S. Miller" , Eric Dumazet , Jakub Kicinski , Paolo Abeni , David Ahern , Shuah Khan , linux-kernel@vger.kernel.org, netdev@vger.kernel.org, linux-kselftest@vger.kernel.org Cc: Stefano Salsano , Paolo Lungaroni , Ahmed Abdelsalam , Andrea Mayer , Hangbin Liu Subject: [net] selftests: srv6: make srv6_end_dt46_l3vpn_test more robust Date: Thu, 27 Apr 2023 11:49:23 +0200 Message-Id: <20230427094923.20432-1-andrea.mayer@uniroma2.it> X-Mailer: git-send-email 2.20.1 MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Virus-Scanned: clamav-milter 0.100.0 at smtp-2015 X-Virus-Status: Clean X-Spam-Status: No, score=-4.2 required=5.0 tests=BAYES_00,RCVD_IN_DNSWL_MED, RCVD_IN_MSPIKE_H3,RCVD_IN_MSPIKE_WL,SPF_HELO_NONE,SPF_PASS, T_SCC_BODY_TEXT_LINE autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On some distributions, the rp_filter is automatically set (=1) by default on a netdev basis (also on VRFs). In an SRv6 End.DT46 behavior, decapsulated IPv4 packets are routed using the table associated with the VRF bound to that tunnel. During lookup operations, the rp_filter can lead to packet loss when activated on the VRF. Therefore, we chose to make this selftest more robust by explicitly disabling the rp_filter during tests (as it is automatically set by some Linux distributions). Fixes: 03a0b567a03d ("selftests: seg6: add selftest for SRv6 End.DT46 Behavior") Reported-by: Hangbin Liu Signed-off-by: Andrea Mayer Tested-by: Hangbin Liu --- .../testing/selftests/net/srv6_end_dt46_l3vpn_test.sh | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/tools/testing/selftests/net/srv6_end_dt46_l3vpn_test.sh b/tools/testing/selftests/net/srv6_end_dt46_l3vpn_test.sh index aebaab8ce44c..441eededa031 100755 --- a/tools/testing/selftests/net/srv6_end_dt46_l3vpn_test.sh +++ b/tools/testing/selftests/net/srv6_end_dt46_l3vpn_test.sh @@ -292,6 +292,11 @@ setup_hs() ip netns exec ${hsname} sysctl -wq net.ipv6.conf.all.accept_dad=0 ip netns exec ${hsname} sysctl -wq net.ipv6.conf.default.accept_dad=0 + # disable the rp_filter otherwise the kernel gets confused about how + # to route decap ipv4 packets. + ip netns exec ${rtname} sysctl -wq net.ipv4.conf.all.rp_filter=0 + ip netns exec ${rtname} sysctl -wq net.ipv4.conf.default.rp_filter=0 + ip -netns ${hsname} link add veth0 type veth peer name ${rtveth} ip -netns ${hsname} link set ${rtveth} netns ${rtname} ip -netns ${hsname} addr add ${IPv6_HS_NETWORK}::${hs}/64 dev veth0 nodad @@ -316,11 +321,6 @@ setup_hs() ip netns exec ${rtname} sysctl -wq net.ipv6.conf.${rtveth}.proxy_ndp=1 ip netns exec ${rtname} sysctl -wq net.ipv4.conf.${rtveth}.proxy_arp=1 - # disable the rp_filter otherwise the kernel gets confused about how - # to route decap ipv4 packets. - ip netns exec ${rtname} sysctl -wq net.ipv4.conf.all.rp_filter=0 - ip netns exec ${rtname} sysctl -wq net.ipv4.conf.${rtveth}.rp_filter=0 - ip netns exec ${rtname} sh -c "echo 1 > /proc/sys/net/vrf/strict_mode" } -- 2.20.1