From: Roi Dayan Date: Tue, 24 Nov 2020 12:28:10 +0000 (+0200) Subject: tc flower: fix parsing vlan_id and vlan_prio X-Git-Tag: v5.11.0~32^2~18 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=ed40b7e2ae4da68e62f30fb1f167d774bce46d50;p=thirdparty%2Fiproute2.git tc flower: fix parsing vlan_id and vlan_prio 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 Signed-off-by: David Ahern --- diff --git a/tc/f_flower.c b/tc/f_flower.c index 58e1140d7..9b278f3c0 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; }