From patchwork Tue Nov 24 12:26:41 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Roi Dayan X-Patchwork-Id: 11928223 X-Patchwork-Delegate: dsahern@gmail.com 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=-16.7 required=3.0 tests=BAYES_00, HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_CR_TRAILER,INCLUDES_PATCH, MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS,UNPARSEABLE_RELAY,URIBL_BLOCKED, USER_AGENT_GIT autolearn=ham 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 350E6C63798 for ; Tue, 24 Nov 2020 12:27:05 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id DD75520B1F for ; Tue, 24 Nov 2020 12:27:04 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S2387572AbgKXM1D (ORCPT ); Tue, 24 Nov 2020 07:27:03 -0500 Received: from mail-il-dmz.mellanox.com ([193.47.165.129]:40711 "EHLO mellanox.co.il" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1729172AbgKXM1D (ORCPT ); Tue, 24 Nov 2020 07:27:03 -0500 Received: from Internal Mail-Server by MTLPINE1 (envelope-from roid@nvidia.com) with SMTP; 24 Nov 2020 14:26:57 +0200 Received: from c-236-0-240-241.mtl.labs.mlnx (c-236-0-240-241.mtl.labs.mlnx [10.236.0.241]) by labmailer.mlnx (8.13.8/8.13.8) with ESMTP id 0AOCQvkW022191; Tue, 24 Nov 2020 14:26:57 +0200 From: Roi Dayan To: netdev@vger.kernel.org Cc: Roi Dayan , Simon Horman , David Ahern , zahari.doychev@linux.com, jianbol@mellanox.com, jhs@mojatatu.com Subject: [PATCH iproute2 1/1] tc flower: fix parsing vlan_id and vlan_prio Date: Tue, 24 Nov 2020 14:26:41 +0200 Message-Id: <20201124122641.46696-1-roid@nvidia.com> X-Mailer: git-send-email 2.25.4 MIME-Version: 1.0 Precedence: bulk List-ID: X-Mailing-List: netdev@vger.kernel.org X-Patchwork-Delegate: dsahern@gmail.com When protocol is vlan then eth_type is set to the vlan eth type. So when parsing vlan_id and vlan_prio need to check tc_proto is vlan and not eth_type. Fixes: 4c551369e083 ("tc flower: use right ethertype in icmp/arp parsing") Signed-off-by: Roi Dayan --- tc/f_flower.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/tc/f_flower.c b/tc/f_flower.c index 58e1140d7391..9b278f3c0e83 100644 --- a/tc/f_flower.c +++ b/tc/f_flower.c @@ -1432,7 +1432,7 @@ static int flower_parse_opt(struct filter_util *qu, char *handle, __u16 vid; NEXT_ARG(); - if (!eth_type_vlan(eth_type)) { + if (!eth_type_vlan(tc_proto)) { fprintf(stderr, "Can't set \"vlan_id\" if ethertype isn't 802.1Q or 802.1AD\n"); return -1; } @@ -1446,7 +1446,7 @@ static int flower_parse_opt(struct filter_util *qu, char *handle, __u8 vlan_prio; NEXT_ARG(); - if (!eth_type_vlan(eth_type)) { + if (!eth_type_vlan(tc_proto)) { fprintf(stderr, "Can't set \"vlan_prio\" if ethertype isn't 802.1Q or 802.1AD\n"); return -1; }