netdev.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH iproute2] tc: simple: don't hardcode the control action
@ 2019-05-31  9:34 Davide Caratti
  2019-06-04 16:56 ` Stephen Hemminger
  0 siblings, 1 reply; 2+ messages in thread
From: Davide Caratti @ 2019-05-31  9:34 UTC (permalink / raw)
  To: aclaudi, marcelo.leitner, Stephen Hemminger, netdev

don't hardcode the 'pipe' control action, so that the following TDC test

 b776 - Replace simple action with invalid goto chain control

can detect kernels that correctly validate 'goto chain' control action.

CC: Andrea Claudi <aclaudi@redhat.com>
CC: Marcelo Ricardo Leitner <marcelo.leitner@gmail.com>
Signed-off-by: Davide Caratti <dcaratti@redhat.com>
---
 tc/m_simple.c | 5 +++--
 1 file changed, 3 insertions(+), 2 deletions(-)

diff --git a/tc/m_simple.c b/tc/m_simple.c
index 886606f9f8b4..e3c8a60ff64a 100644
--- a/tc/m_simple.c
+++ b/tc/m_simple.c
@@ -119,6 +119,9 @@ parse_simple(struct action_util *a, int *argc_p, char ***argv_p, int tca_id,
 		}
 	}
 
+	parse_action_control_dflt(&argc, &argv, &sel.action, false,
+				  TC_ACT_PIPE);
+
 	if (argc) {
 		if (matches(*argv, "index") == 0) {
 			NEXT_ARG();
@@ -144,8 +147,6 @@ parse_simple(struct action_util *a, int *argc_p, char ***argv_p, int tca_id,
 		return -1;
 	}
 
-	sel.action = TC_ACT_PIPE;
-
 	tail = addattr_nest(n, MAX_MSG, tca_id);
 	addattr_l(n, MAX_MSG, TCA_DEF_PARMS, &sel, sizeof(sel));
 	if (simpdata)
-- 
2.20.1


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

* Re: [PATCH iproute2] tc: simple: don't hardcode the control action
  2019-05-31  9:34 [PATCH iproute2] tc: simple: don't hardcode the control action Davide Caratti
@ 2019-06-04 16:56 ` Stephen Hemminger
  0 siblings, 0 replies; 2+ messages in thread
From: Stephen Hemminger @ 2019-06-04 16:56 UTC (permalink / raw)
  To: Davide Caratti; +Cc: aclaudi, marcelo.leitner, netdev

On Fri, 31 May 2019 11:34:46 +0200
Davide Caratti <dcaratti@redhat.com> wrote:

> don't hardcode the 'pipe' control action, so that the following TDC test
> 
>  b776 - Replace simple action with invalid goto chain control
> 
> can detect kernels that correctly validate 'goto chain' control action.
> 
> CC: Andrea Claudi <aclaudi@redhat.com>
> CC: Marcelo Ricardo Leitner <marcelo.leitner@gmail.com>
> Signed-off-by: Davide Caratti <dcaratti@redhat.com>

The commit message is too short for me to understand exactly what
you are trying to fix, and what the test does.

Please resubmit with a more complete description. Including before/after.

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

end of thread, other threads:[~2019-06-04 16:56 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2019-05-31  9:34 [PATCH iproute2] tc: simple: don't hardcode the control action Davide Caratti
2019-06-04 16:56 ` 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).