netdev.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH iproute2 0/2] two small fixes in flower option parser error flow
@ 2017-01-19 12:31 Roi Dayan
  2017-01-19 12:31 ` [PATCH iproute2 1/2] tc: flower: Add missing err check when parsing flower options Roi Dayan
                   ` (2 more replies)
  0 siblings, 3 replies; 4+ messages in thread
From: Roi Dayan @ 2017-01-19 12:31 UTC (permalink / raw)
  To: Stephen Hemminger
  Cc: netdev, Amir Vadai, Jiri Pirko, Jamal Hadi Salim, Paul Blakey,
	Roi Dayan

Hi,

the first adds a missing return check and the second removes
an incorrect error msg.

Thanks,
Roi


Roi Dayan (2):
  tc: flower: Add missing err check when parsing flower options
  tc: flower: Fix incorrect error msg about eth type

 tc/f_flower.c |   11 +++++------
 1 files changed, 5 insertions(+), 6 deletions(-)

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

* [PATCH iproute2 1/2] tc: flower: Add missing err check when parsing flower options
  2017-01-19 12:31 [PATCH iproute2 0/2] two small fixes in flower option parser error flow Roi Dayan
@ 2017-01-19 12:31 ` Roi Dayan
  2017-01-19 12:31 ` [PATCH iproute2 2/2] tc: flower: Fix incorrect error msg about eth type Roi Dayan
  2017-01-20 17:30 ` [PATCH iproute2 0/2] two small fixes in flower option parser error flow Stephen Hemminger
  2 siblings, 0 replies; 4+ messages in thread
From: Roi Dayan @ 2017-01-19 12:31 UTC (permalink / raw)
  To: Stephen Hemminger
  Cc: netdev, Amir Vadai, Jiri Pirko, Jamal Hadi Salim, Paul Blakey,
	Roi Dayan

addattr32 may return an error.

Fixes: cfcabf18d84a ("tc: flower: Add skip_{hw|sw} support")
Signed-off-by: Roi Dayan <roid@mellanox.com>
Reviewed-by: Paul Blakey <paulb@mellanox.com>
---
 tc/f_flower.c |    4 +++-
 1 files changed, 3 insertions(+), 1 deletions(-)

diff --git a/tc/f_flower.c b/tc/f_flower.c
index 1dbc532..1272a47 100644
--- a/tc/f_flower.c
+++ b/tc/f_flower.c
@@ -525,7 +525,9 @@ static int flower_parse_opt(struct filter_util *qu, char *handle,
 	}
 
 parse_done:
-	addattr32(n, MAX_MSG, TCA_FLOWER_FLAGS, flags);
+	ret = addattr32(n, MAX_MSG, TCA_FLOWER_FLAGS, flags);
+	if (ret)
+		return ret;
 
 	ret = addattr16(n, MAX_MSG, TCA_FLOWER_KEY_ETH_TYPE, eth_type);
 	if (ret) {
-- 
1.7.1

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

* [PATCH iproute2 2/2] tc: flower: Fix incorrect error msg about eth type
  2017-01-19 12:31 [PATCH iproute2 0/2] two small fixes in flower option parser error flow Roi Dayan
  2017-01-19 12:31 ` [PATCH iproute2 1/2] tc: flower: Add missing err check when parsing flower options Roi Dayan
@ 2017-01-19 12:31 ` Roi Dayan
  2017-01-20 17:30 ` [PATCH iproute2 0/2] two small fixes in flower option parser error flow Stephen Hemminger
  2 siblings, 0 replies; 4+ messages in thread
From: Roi Dayan @ 2017-01-19 12:31 UTC (permalink / raw)
  To: Stephen Hemminger
  Cc: netdev, Amir Vadai, Jiri Pirko, Jamal Hadi Salim, Paul Blakey,
	Roi Dayan

addattr16 may return an error about the nl msg size
but not about incorrect eth type.

Fixes: 488b41d020fb ("tc: flower no need to specify the ethertype")
Signed-off-by: Roi Dayan <roid@mellanox.com>
Reviewed-by: Paul Blakey <paulb@mellanox.com>
---
 tc/f_flower.c |    7 ++-----
 1 files changed, 2 insertions(+), 5 deletions(-)

diff --git a/tc/f_flower.c b/tc/f_flower.c
index 1272a47..314c2dd 100644
--- a/tc/f_flower.c
+++ b/tc/f_flower.c
@@ -530,11 +530,8 @@ parse_done:
 		return ret;
 
 	ret = addattr16(n, MAX_MSG, TCA_FLOWER_KEY_ETH_TYPE, eth_type);
-	if (ret) {
-		fprintf(stderr, "Illegal \"eth_type\"(0x%x)\n",
-			ntohs(eth_type));
-		return -1;
-	}
+	if (ret)
+		return ret;
 
 	tail->rta_len = (((void *)n)+n->nlmsg_len) - (void *)tail;
 
-- 
1.7.1

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

* Re: [PATCH iproute2 0/2] two small fixes in flower option parser error flow
  2017-01-19 12:31 [PATCH iproute2 0/2] two small fixes in flower option parser error flow Roi Dayan
  2017-01-19 12:31 ` [PATCH iproute2 1/2] tc: flower: Add missing err check when parsing flower options Roi Dayan
  2017-01-19 12:31 ` [PATCH iproute2 2/2] tc: flower: Fix incorrect error msg about eth type Roi Dayan
@ 2017-01-20 17:30 ` Stephen Hemminger
  2 siblings, 0 replies; 4+ messages in thread
From: Stephen Hemminger @ 2017-01-20 17:30 UTC (permalink / raw)
  To: Roi Dayan; +Cc: netdev, Amir Vadai, Jiri Pirko, Jamal Hadi Salim, Paul Blakey

On Thu, 19 Jan 2017 14:31:18 +0200
Roi Dayan <roid@mellanox.com> wrote:

> Hi,
> 
> the first adds a missing return check and the second removes
> an incorrect error msg.
> 
> Thanks,
> Roi
> 
> 
> Roi Dayan (2):
>   tc: flower: Add missing err check when parsing flower options
>   tc: flower: Fix incorrect error msg about eth type
> 
>  tc/f_flower.c |   11 +++++------
>  1 files changed, 5 insertions(+), 6 deletions(-)
> 

Both applied

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

end of thread, other threads:[~2017-01-20 17:30 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2017-01-19 12:31 [PATCH iproute2 0/2] two small fixes in flower option parser error flow Roi Dayan
2017-01-19 12:31 ` [PATCH iproute2 1/2] tc: flower: Add missing err check when parsing flower options Roi Dayan
2017-01-19 12:31 ` [PATCH iproute2 2/2] tc: flower: Fix incorrect error msg about eth type Roi Dayan
2017-01-20 17:30 ` [PATCH iproute2 0/2] two small fixes in flower option parser error flow Stephen Hemminger

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).