* [PATCH v2 iproute2] f_flower: don't set TCA_FLOWER_KEY_ETH_TYPE for "protocol all"
@ 2017-01-20 19:07 Benjamin LaHaise
2017-01-26 7:13 ` Roi Dayan
2017-01-30 4:24 ` Stephen Hemminger
0 siblings, 2 replies; 3+ messages in thread
From: Benjamin LaHaise @ 2017-01-20 19:07 UTC (permalink / raw)
To: Stephen Hemminger; +Cc: Jamal Hadi Salim, netdev, bcrl
v2 - update to address changes in 00697ca19ae3e1118f2af82c3b41ac4335fe918b.
When using the tc flower filter, rules marked with "protocol all" do not
actually match all packets. This is due to a bug in f_flower.c that passes
in ETH_P_ALL in the TCA_FLOWER_KEY_ETH_TYPE attribute when adding a rule.
Fix this by omitting TCA_FLOWER_KEY_ETH_TYPE if the protocol is set to
ETH_P_ALL.
Fixes: 488b41d020fb ("tc: flower no need to specify the ethertype")
Cc: Jamal Hadi Salim <jhs@mojatatu.com>
Signed-off-by: Benjamin LaHaise <benjamin.lahaise@netronome.com>
Signed-off-by: Benjamin LaHaise <bcrl@kvack.org>
diff --git a/tc/f_flower.c b/tc/f_flower.c
index 314c2dd..145a856 100644
--- a/tc/f_flower.c
+++ b/tc/f_flower.c
@@ -529,9 +529,11 @@ parse_done:
if (ret)
return ret;
- ret = addattr16(n, MAX_MSG, TCA_FLOWER_KEY_ETH_TYPE, eth_type);
- if (ret)
- return ret;
+ if (eth_type != htons(ETH_P_ALL)) {
+ ret = addattr16(n, MAX_MSG, TCA_FLOWER_KEY_ETH_TYPE, eth_type);
+ if (ret)
+ return ret;
+ }
tail->rta_len = (((void *)n)+n->nlmsg_len) - (void *)tail;
^ permalink raw reply related [flat|nested] 3+ messages in thread
* Re: [PATCH v2 iproute2] f_flower: don't set TCA_FLOWER_KEY_ETH_TYPE for "protocol all"
2017-01-20 19:07 [PATCH v2 iproute2] f_flower: don't set TCA_FLOWER_KEY_ETH_TYPE for "protocol all" Benjamin LaHaise
@ 2017-01-26 7:13 ` Roi Dayan
2017-01-30 4:24 ` Stephen Hemminger
1 sibling, 0 replies; 3+ messages in thread
From: Roi Dayan @ 2017-01-26 7:13 UTC (permalink / raw)
To: Benjamin LaHaise, Stephen Hemminger; +Cc: Jamal Hadi Salim, netdev, bcrl
On 20/01/2017 21:07, Benjamin LaHaise wrote:
> v2 - update to address changes in 00697ca19ae3e1118f2af82c3b41ac4335fe918b.
>
> When using the tc flower filter, rules marked with "protocol all" do not
> actually match all packets. This is due to a bug in f_flower.c that passes
> in ETH_P_ALL in the TCA_FLOWER_KEY_ETH_TYPE attribute when adding a rule.
> Fix this by omitting TCA_FLOWER_KEY_ETH_TYPE if the protocol is set to
> ETH_P_ALL.
>
> Fixes: 488b41d020fb ("tc: flower no need to specify the ethertype")
> Cc: Jamal Hadi Salim <jhs@mojatatu.com>
> Signed-off-by: Benjamin LaHaise <benjamin.lahaise@netronome.com>
> Signed-off-by: Benjamin LaHaise <bcrl@kvack.org>
>
> diff --git a/tc/f_flower.c b/tc/f_flower.c
> index 314c2dd..145a856 100644
> --- a/tc/f_flower.c
> +++ b/tc/f_flower.c
> @@ -529,9 +529,11 @@ parse_done:
> if (ret)
> return ret;
>
> - ret = addattr16(n, MAX_MSG, TCA_FLOWER_KEY_ETH_TYPE, eth_type);
> - if (ret)
> - return ret;
> + if (eth_type != htons(ETH_P_ALL)) {
> + ret = addattr16(n, MAX_MSG, TCA_FLOWER_KEY_ETH_TYPE, eth_type);
> + if (ret)
> + return ret;
> + }
>
> tail->rta_len = (((void *)n)+n->nlmsg_len) - (void *)tail;
>
Reviewed-by: Roi Dayan <roid@mellanox.com>
^ permalink raw reply [flat|nested] 3+ messages in thread
* Re: [PATCH v2 iproute2] f_flower: don't set TCA_FLOWER_KEY_ETH_TYPE for "protocol all"
2017-01-20 19:07 [PATCH v2 iproute2] f_flower: don't set TCA_FLOWER_KEY_ETH_TYPE for "protocol all" Benjamin LaHaise
2017-01-26 7:13 ` Roi Dayan
@ 2017-01-30 4:24 ` Stephen Hemminger
1 sibling, 0 replies; 3+ messages in thread
From: Stephen Hemminger @ 2017-01-30 4:24 UTC (permalink / raw)
To: Benjamin LaHaise; +Cc: Jamal Hadi Salim, netdev, bcrl
On Fri, 20 Jan 2017 14:07:38 -0500
Benjamin LaHaise <benjamin.lahaise@netronome.com> wrote:
> v2 - update to address changes in 00697ca19ae3e1118f2af82c3b41ac4335fe918b.
>
> When using the tc flower filter, rules marked with "protocol all" do not
> actually match all packets. This is due to a bug in f_flower.c that passes
> in ETH_P_ALL in the TCA_FLOWER_KEY_ETH_TYPE attribute when adding a rule.
> Fix this by omitting TCA_FLOWER_KEY_ETH_TYPE if the protocol is set to
> ETH_P_ALL.
>
> Fixes: 488b41d020fb ("tc: flower no need to specify the ethertype")
> Cc: Jamal Hadi Salim <jhs@mojatatu.com>
> Signed-off-by: Benjamin LaHaise <benjamin.lahaise@netronome.com>
> Signed-off-by: Benjamin LaHaise <bcrl@kvack.org>
Applied, thanks.
^ permalink raw reply [flat|nested] 3+ messages in thread
end of thread, other threads:[~2017-01-30 4:25 UTC | newest]
Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2017-01-20 19:07 [PATCH v2 iproute2] f_flower: don't set TCA_FLOWER_KEY_ETH_TYPE for "protocol all" Benjamin LaHaise
2017-01-26 7:13 ` Roi Dayan
2017-01-30 4:24 ` Stephen Hemminger
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.