Skip to contentSkip to conversation

tc flower: fix parsing vlan_id and vlan_prio

PATCH Applied Roi Dayan 4 participants 4 messages Nov 24, 2020 – Nov 25, 2020

Subsystems (2)
lore
Share & tools
lore

Roi Dayan

author
#0 lore raw

PATCH 1/1 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")
---
 tc/f_flower.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)
tc/f_flower.c +2 -2
index 58e1140d7391..9b278f3c0e83 100644
@@ -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;
 			}
Signature · 1 line
2.25.4
#1 lore raw
Quoted 25 lines · Roi Dayan

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")
---
 tc/f_flower.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)
tc/f_flower.c +1 -1
index 58e1140d7391..9b278f3c0e83 100644
@@ -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;
 			}

tc/f_flower.c static int flower_parse_opt(struct filter_util *qu, char *handle, · line 1452

Quoted 8 lines
tc/f_flower.c +1 -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;
 			}

Thanks for fixing this. I missed to test the option odering in my tests. Your fix works fine for me. Sorry for missing this.

Quoted 1 line

2.25.4

Applied
#2 lore raw
In reply to Roi Dayan
Quoted 10 lines · Roi Dayan

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")
---
 tc/f_flower.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

applied. Thanks for the fix.

#3 lore raw
In reply to Roi Dayan
This patch was applied to iproute2/iproute2-next.git (refs/heads/main):

Hello:

This patch was applied to iproute2/iproute2-next.git (refs/heads/main):

Quoted 8 lines · On Tue, 24 Nov 2020 14:28:10 +0200 you wrote:

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")

[...]

Here is the summary with links:
- [iproute2-next,1/1] tc flower: fix parsing vlan_id and vlan_prio

    https://git.kernel.org/pub/scm/network/iproute2/iproute2-next.git/commit/?id=ed40b7e2ae4d

You are awesome, thank you!
--
Deet-doot-dot, I am a bot.
https://korg.docs.kernel.org/patchwork/pwbot.html