Received: by 2002:a05:6a10:9848:0:0:0:0 with SMTP id x8csp3422473pxf; Mon, 29 Mar 2021 01:37:00 -0700 (PDT) X-Google-Smtp-Source: ABdhPJwU1PRbIBD+FecX8O8kSlCmZCRKbXD/InvWuJReyggizq6ttDqegzPS8OYGqOmqc27S6OJU X-Received: by 2002:a05:6402:1691:: with SMTP id a17mr27665736edv.336.1617007020293; Mon, 29 Mar 2021 01:37:00 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1617007020; cv=none; d=google.com; s=arc-20160816; b=xJvDA93w7lybruFAd50hPH9xJR7k1bKNGP/mK0Umg+PX+no0yErjzgcgMcg4FFfUpe Tgt+SNXEYBV7THbB4ZhzHfwj5yYuetsjZstjjHG1FK7t4VKV7BI+lf84wu6zCn2edlk0 HnWZ5NSdXH+YcPnFCrTnN8SEUy0foBjM9Yoi43U0FYHBOOX1Y64gEtUw/bH9Gi4vk/nk zpYaY8BszIDKF5zHIWIc1VAcw74PmQZqDWSCLboWZ8fp7F8d3CkcxbW49mvWgzGbpROt jiBS8sEOO++uTieQGAmCiapWWq2wv2zwVkzeZp2O5iIU3LrnFfuKjtoCrmlXYrr3TveC 1PRA== 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=ddEI/WShY4n+LwrM4cmqUn9fiODjwCMIFArVShSBtcI=; b=HGaoe6FPwr4BaX1wxg9RwlOW06uWgUxV/nQXdPtTPFS98IOzH8zDKnoFGyh/bwQZdS cgr0Zmff+Y44grlTGsXmPZEVodwIR33sQK6uNsf8POx3pV9C51G9LoQ8ajQTgRvcp5n4 +8A4OjiQJ98NSARMzpm+/HKEuHJndxdVpLPQVmJM/pOiP7HTErTDJ4dwlOfrNrHBsXn0 acvRNAniMwP3aE/iolZ7YCTk7Gc5cStYt3BGPLSZ6MQElOsp8ZDk9X+YScf+To74DUhQ tMt9N41BtzIZa9aKloLCAHqrqHFnlpdC1TpWr4nWwTS2wcIEli+6vHcKny9PldtdQwvp hVPw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=lpZZMhEj; 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 go41si12937342ejc.135.2021.03.29.01.36.37; Mon, 29 Mar 2021 01:37:00 -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=lpZZMhEj; 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 S233595AbhC2IfU (ORCPT + 99 others); Mon, 29 Mar 2021 04:35:20 -0400 Received: from mail.kernel.org ([198.145.29.99]:38318 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S233087AbhC2IVj (ORCPT ); Mon, 29 Mar 2021 04:21:39 -0400 Received: by mail.kernel.org (Postfix) with ESMTPSA id ED5F261878; Mon, 29 Mar 2021 08:21:37 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1617006098; bh=e53U7nlaCOALcoWHSz0ckvm1wTTWN1D9h3L20DQAsZA=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=lpZZMhEjl3l5vCXxNxi04Lcb0L+e0wcRHZvv1qYFBvxeXtqAYHP4LdLbnXg15PJpF OumpJ4c9iu2s/T3dUQrR0K64db4LAAxqUof2Akxma+FjmqXoPnbicXsGloVwi/PP48 toP/KYiiKFvEuJWEKsxDrylAwsM2UxIIGOZEEsHc= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Hangbin Liu , Daniel Borkmann , William Tu , Sasha Levin Subject: [PATCH 5.10 118/221] selftests/bpf: Set gopt opt_class to 0 if get tunnel opt failed Date: Mon, 29 Mar 2021 09:57:29 +0200 Message-Id: <20210329075633.141934628@linuxfoundation.org> X-Mailer: git-send-email 2.31.1 In-Reply-To: <20210329075629.172032742@linuxfoundation.org> References: <20210329075629.172032742@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: Hangbin Liu [ Upstream commit 31254dc9566221429d2cfb45fd5737985d70f2b6 ] When fixing the bpf test_tunnel.sh geneve failure. I only fixed the IPv4 part but forgot the IPv6 issue. Similar with the IPv4 fixes 557c223b643a ("selftests/bpf: No need to drop the packet when there is no geneve opt"), when there is no tunnel option and bpf_skb_get_tunnel_opt() returns error, there is no need to drop the packets and break all geneve rx traffic. Just set opt_class to 0 and keep returning TC_ACT_OK at the end. Fixes: 557c223b643a ("selftests/bpf: No need to drop the packet when there is no geneve opt") Fixes: 933a741e3b82 ("selftests/bpf: bpf tunnel test.") Signed-off-by: Hangbin Liu Signed-off-by: Daniel Borkmann Acked-by: William Tu Link: https://lore.kernel.org/bpf/20210309032214.2112438-1-liuhangbin@gmail.com Signed-off-by: Sasha Levin --- tools/testing/selftests/bpf/progs/test_tunnel_kern.c | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/tools/testing/selftests/bpf/progs/test_tunnel_kern.c b/tools/testing/selftests/bpf/progs/test_tunnel_kern.c index 9afe947cfae9..ba6eadfec565 100644 --- a/tools/testing/selftests/bpf/progs/test_tunnel_kern.c +++ b/tools/testing/selftests/bpf/progs/test_tunnel_kern.c @@ -508,10 +508,8 @@ int _ip6geneve_get_tunnel(struct __sk_buff *skb) } ret = bpf_skb_get_tunnel_opt(skb, &gopt, sizeof(gopt)); - if (ret < 0) { - ERROR(ret); - return TC_ACT_SHOT; - } + if (ret < 0) + gopt.opt_class = 0; bpf_trace_printk(fmt, sizeof(fmt), key.tunnel_id, key.remote_ipv4, gopt.opt_class); -- 2.30.1