From: Jamal Hadi Salim <jhs@mojatatu.com>
To: stephen@networkplumber.org
Cc: jiri@resnulli.us, netdev@vger.kernel.org,
Jamal Hadi Salim <jhs@mojatatu.com>
Subject: [iproute2 PATCH 1/1] actions: Get vlan action to work in pipeline
Date: Sun, 11 Jan 2015 09:31:30 -0500 [thread overview]
Message-ID: <1420986690-1563-1-git-send-email-jhs@emojatatu.com> (raw)
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 --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);
--
1.7.9.5
reply other threads:[~2015-01-11 14:33 UTC|newest]
Thread overview: [no followups] expand[flat|nested] mbox.gz Atom feed
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=1420986690-1563-1-git-send-email-jhs@emojatatu.com \
--to=jhs@mojatatu.com \
--cc=jiri@resnulli.us \
--cc=netdev@vger.kernel.org \
--cc=stephen@networkplumber.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox