public inbox for netdev@vger.kernel.org
 help / color / mirror / Atom feed
* [PATCH iproute2-next 1/1] tc flower: fix parsing vlan_id and vlan_prio
@ 2020-11-24 12:28 Roi Dayan
  2020-11-24 12:42 ` Zahari Doychev
                   ` (2 more replies)
  0 siblings, 3 replies; 4+ messages in thread
From: Roi Dayan @ 2020-11-24 12:28 UTC (permalink / raw)
  To: netdev; +Cc: Roi Dayan, Simon Horman, David Ahern, zahari.doychev, jianbol,
	jhs

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


^ permalink raw reply related	[flat|nested] 4+ messages in thread

* Re: [PATCH iproute2-next 1/1] tc flower: fix parsing vlan_id and vlan_prio
  2020-11-24 12:28 [PATCH iproute2-next 1/1] tc flower: fix parsing vlan_id and vlan_prio Roi Dayan
@ 2020-11-24 12:42 ` Zahari Doychev
  2020-11-25  4:46 ` David Ahern
  2020-11-25  4:50 ` patchwork-bot+netdevbpf
  2 siblings, 0 replies; 4+ messages in thread
From: Zahari Doychev @ 2020-11-24 12:42 UTC (permalink / raw)
  To: Roi Dayan; +Cc: netdev, Simon Horman, David Ahern, jianbol, jhs

On Tue, Nov 24, 2020 at 02:28:10PM +0200, Roi Dayan 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")
> 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;
>  			}
> -- 

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

> 2.25.4

^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: [PATCH iproute2-next 1/1] tc flower: fix parsing vlan_id and vlan_prio
  2020-11-24 12:28 [PATCH iproute2-next 1/1] tc flower: fix parsing vlan_id and vlan_prio Roi Dayan
  2020-11-24 12:42 ` Zahari Doychev
@ 2020-11-25  4:46 ` David Ahern
  2020-11-25  4:50 ` patchwork-bot+netdevbpf
  2 siblings, 0 replies; 4+ messages in thread
From: David Ahern @ 2020-11-25  4:46 UTC (permalink / raw)
  To: Roi Dayan, netdev; +Cc: Simon Horman, zahari.doychev, jianbol, jhs

On 11/24/20 5:28 AM, Roi Dayan 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")
> Signed-off-by: Roi Dayan <roid@nvidia.com>
> ---
>  tc/f_flower.c | 4 ++--
>  1 file changed, 2 insertions(+), 2 deletions(-)
> 

applied. Thanks for the fix.


^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: [PATCH iproute2-next 1/1] tc flower: fix parsing vlan_id and vlan_prio
  2020-11-24 12:28 [PATCH iproute2-next 1/1] tc flower: fix parsing vlan_id and vlan_prio Roi Dayan
  2020-11-24 12:42 ` Zahari Doychev
  2020-11-25  4:46 ` David Ahern
@ 2020-11-25  4:50 ` patchwork-bot+netdevbpf
  2 siblings, 0 replies; 4+ messages in thread
From: patchwork-bot+netdevbpf @ 2020-11-25  4:50 UTC (permalink / raw)
  To: Roi Dayan; +Cc: netdev, simon.horman, dsahern, zahari.doychev, jianbol, jhs

Hello:

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

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")
> Signed-off-by: Roi Dayan <roid@nvidia.com>
> 
> [...]

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



^ permalink raw reply	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2020-11-25  4:50 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2020-11-24 12:28 [PATCH iproute2-next 1/1] tc flower: fix parsing vlan_id and vlan_prio Roi Dayan
2020-11-24 12:42 ` Zahari Doychev
2020-11-25  4:46 ` David Ahern
2020-11-25  4:50 ` patchwork-bot+netdevbpf

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox