diff mbox series

[iproute2,v2] m_mirred: don't bail if the control action is missing

Message ID fb92be6e671450d181f552c883feae849f840283.1558345901.git.pabeni@redhat.com
State Accepted
Delegated to: stephen hemminger
Headers show
Series [iproute2,v2] m_mirred: don't bail if the control action is missing | expand

Commit Message

Paolo Abeni May 20, 2019, 9:56 a.m. UTC
The mirred act admits an optional control action, defaulting
to TC_ACT_PIPE. The parsing code currently emits an error message
if the control action is not provided on the command line, even
if the command itself completes with no error.

This change shuts down the error message, using the appropriate
parsing helper.

Fixes: e67aba559581 ("tc: actions: add helpers to parse and print control actions")
Signed-off-by: Paolo Abeni <pabeni@redhat.com>
---
v1 -> v2:
 - add missing recipients, sorry for the unneeded duplicates to
   the initial, partial list
---
 tc/m_mirred.c | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

Comments

Roman Mashak May 20, 2019, 1:05 p.m. UTC | #1
On Mon, May 20, 2019 at 5:58 AM Paolo Abeni <pabeni@redhat.com> wrote:
>
> The mirred act admits an optional control action, defaulting
> to TC_ACT_PIPE. The parsing code currently emits an error message
> if the control action is not provided on the command line, even
> if the command itself completes with no error.
>
> This change shuts down the error message, using the appropriate
> parsing helper.
>

[...]

Paolo, could you also update the relevant tdc mirred test once this
patch is accepted? Thank you.
Stephen Hemminger May 22, 2019, 6:52 p.m. UTC | #2
On Mon, 20 May 2019 11:56:52 +0200
Paolo Abeni <pabeni@redhat.com> wrote:

> The mirred act admits an optional control action, defaulting
> to TC_ACT_PIPE. The parsing code currently emits an error message
> if the control action is not provided on the command line, even
> if the command itself completes with no error.
> 
> This change shuts down the error message, using the appropriate
> parsing helper.
> 
> Fixes: e67aba559581 ("tc: actions: add helpers to parse and print control actions")
> Signed-off-by: Paolo Abeni <pabeni@redhat.com>

Applied
diff mbox series

Patch

diff --git a/tc/m_mirred.c b/tc/m_mirred.c
index c7f7318b..23ba638a 100644
--- a/tc/m_mirred.c
+++ b/tc/m_mirred.c
@@ -202,7 +202,8 @@  parse_direction(struct action_util *a, int *argc_p, char ***argv_p,
 
 
 	if (p.eaction == TCA_EGRESS_MIRROR || p.eaction == TCA_INGRESS_MIRROR)
-		parse_action_control(&argc, &argv, &p.action, false);
+		parse_action_control_dflt(&argc, &argv, &p.action, false,
+					  TC_ACT_PIPE);
 
 	if (argc) {
 		if (iok && matches(*argv, "index") == 0) {