diff mbox

[iproute2,1/1] actions: Get vlan action to work in pipeline

Message ID 1420986690-1563-1-git-send-email-jhs@emojatatu.com
State Accepted, archived
Delegated to: stephen hemminger
Headers show

Commit Message

Jamal Hadi Salim Jan. 11, 2015, 2:31 p.m. UTC
From: Jamal Hadi Salim <jhs@mojatatu.com>

When specified in a graph such as:
action vlan ... action foobar
the vlan action chewed more than it can swallow

Signed-off-by: Jamal Hadi Salim <jhs@mojatatu.com>
---
 tc/m_vlan.c |   16 +++++++++++-----
 1 file changed, 11 insertions(+), 5 deletions(-)
diff mbox

Patch

diff --git a/tc/m_vlan.c b/tc/m_vlan.c
index 171d268..32db5ed 100644
--- a/tc/m_vlan.c
+++ b/tc/m_vlan.c
@@ -103,20 +103,25 @@  static int parse_vlan(struct action_util *a, int *argc_p, char ***argv_p,
 	if (argc) {
 		if (matches(*argv, "reclassify") == 0) {
 			parm.action = TC_ACT_RECLASSIFY;
-			NEXT_ARG();
+			argc--;
+			argv++;
 		} else if (matches(*argv, "pipe") == 0) {
 			parm.action = TC_ACT_PIPE;
-			NEXT_ARG();
+			argc--;
+			argv++;
 		} else if (matches(*argv, "drop") == 0 ||
 			   matches(*argv, "shot") == 0) {
 			parm.action = TC_ACT_SHOT;
-			NEXT_ARG();
+			argc--;
+			argv++;
 		} else if (matches(*argv, "continue") == 0) {
 			parm.action = TC_ACT_UNSPEC;
-			NEXT_ARG();
+			argc--;
+			argv++;
 		} else if (matches(*argv, "pass") == 0) {
 			parm.action = TC_ACT_OK;
-			NEXT_ARG();
+			argc--;
+			argv++;
 		}
 	}
 
@@ -198,6 +203,7 @@  static int print_vlan(struct action_util *au, FILE *f, struct rtattr *arg)
 		}
 		break;
 	}
+	fprintf(f, " %s", action_n2a(parm->action, b1, sizeof (b1)));
 
 	fprintf(f, "\n\t index %d ref %d bind %d", parm->index, parm->refcnt,
 		parm->bindcnt);