Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id 4353CC433F5 for ; Mon, 20 Dec 2021 14:48:24 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S237168AbhLTOsX (ORCPT ); Mon, 20 Dec 2021 09:48:23 -0500 Received: from dfw.source.kernel.org ([139.178.84.217]:38566 "EHLO dfw.source.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S236275AbhLTOqC (ORCPT ); Mon, 20 Dec 2021 09:46:02 -0500 Received: from smtp.kernel.org (relay.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by dfw.source.kernel.org (Postfix) with ESMTPS id 77B1661165; Mon, 20 Dec 2021 14:46:01 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 8778AC36AE9; Mon, 20 Dec 2021 14:46:00 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1640011560; bh=d+/gY9c2xA9+eLrDX51PkG3V/Y/0vFW+9FoAWStkb2E=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=x9U2g0n1z6ww9uOIEfgzBHX8w6DPLA5543EW+SuskeBKHMN/g62aFEQ0Tx3pcAfwh tyJhyyPjHg31Q7YaUFK7XgaXdn/scLa0aktsaICOSy/Ac280bFRCUOCTiLND6AWCgD AtBS9pBN4MQwfOS4FrVRCpR+WmoaEaEVYbPPhNrc= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Baowen Zheng , Simon Horman , Jamal Hadi Salim , "David S. Miller" , Sasha Levin Subject: [PATCH 5.4 32/71] flow_offload: return EOPNOTSUPP for the unsupported mpls action type Date: Mon, 20 Dec 2021 15:34:21 +0100 Message-Id: <20211220143026.765103269@linuxfoundation.org> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20211220143025.683747691@linuxfoundation.org> References: <20211220143025.683747691@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: Baowen Zheng [ Upstream commit 166b6a46b78bf8b9559a6620c3032f9fe492e082 ] We need to return EOPNOTSUPP for the unsupported mpls action type when setup the flow action. In the original implement, we will return 0 for the unsupported mpls action type, actually we do not setup it and the following actions to the flow action entry. Fixes: 9838b20a7fb2 ("net: sched: take rtnl lock in tc_setup_flow_action()") Signed-off-by: Baowen Zheng Signed-off-by: Simon Horman Acked-by: Jamal Hadi Salim Signed-off-by: David S. Miller Signed-off-by: Sasha Levin --- net/sched/cls_api.c | 1 + 1 file changed, 1 insertion(+) diff --git a/net/sched/cls_api.c b/net/sched/cls_api.c index 61aa63cc170b4..a4c61205462ac 100644 --- a/net/sched/cls_api.c +++ b/net/sched/cls_api.c @@ -3562,6 +3562,7 @@ int tc_setup_flow_action(struct flow_action *flow_action, entry->mpls_mangle.ttl = tcf_mpls_ttl(act); break; default: + err = -EOPNOTSUPP; goto err_out_locked; } } else if (is_tcf_skbedit_ptype(act)) { -- 2.33.0