public inbox for netdev@vger.kernel.org
 help / color / mirror / Atom feed
From: Roi Dayan <roid@nvidia.com>
To: netdev@vger.kernel.org
Cc: Roi Dayan <roid@nvidia.com>,
	Simon Horman <simon.horman@netronome.com>,
	David Ahern <dsahern@gmail.com>,
	zahari.doychev@linux.com, jianbol@mellanox.com, jhs@mojatatu.com
Subject: [PATCH iproute2-next 1/1] tc flower: fix parsing vlan_id and vlan_prio
Date: Tue, 24 Nov 2020 14:28:10 +0200	[thread overview]
Message-ID: <20201124122810.46790-1-roid@nvidia.com> (raw)

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 <roid@nvidia.com>
---
 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;
 			}
-- 
2.25.4


             reply	other threads:[~2020-11-24 12:29 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-11-24 12:28 Roi Dayan [this message]
2020-11-24 12:42 ` [PATCH iproute2-next 1/1] tc flower: fix parsing vlan_id and vlan_prio Zahari Doychev
2020-11-25  4:46 ` David Ahern
2020-11-25  4:50 ` patchwork-bot+netdevbpf

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20201124122810.46790-1-roid@nvidia.com \
    --to=roid@nvidia.com \
    --cc=dsahern@gmail.com \
    --cc=jhs@mojatatu.com \
    --cc=jianbol@mellanox.com \
    --cc=netdev@vger.kernel.org \
    --cc=simon.horman@netronome.com \
    --cc=zahari.doychev@linux.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox