From: Patrick McHardy Date: Wed, 18 Jul 2007 10:46:20 +0000 (+0200) Subject: Bug fix tc action drop X-Git-Tag: v2.6.23-071016~37 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=c29391c7c68f031e246c661ec1d4346693d5e445;p=thirdparty%2Fiproute2.git Bug fix tc action drop >>That command is from a script that used to work with iproute2-ss020116 >>(2002!), which had the following in tc/m_police.c: >> >>210 } else if (strcmp(*argv, "action") == 0) { >>211 NEXT_ARG(); >>212 if (get_police_result(&p.action, &presult, *argv)) { >> >>I don't know when that bit was dropped, but it used to be there. :-) > > > > Indeed, I missed that. I'll fix up the patch .. OK this patch fixes parsing of "action ...". I've removed the erroring on unknown arguments again since in that case the caller should continue parsing. --- diff --git a/tc/m_police.c b/tc/m_police.c index 62e37f9dc..5d2528b85 100644 --- a/tc/m_police.c +++ b/tc/m_police.c @@ -227,7 +227,8 @@ int act_parse_police(struct action_util *a,int *argc_p, char ***argv_p, int tca_ p.action = TC_POLICE_OK; } else if (matches(*argv, "pipe") == 0) { p.action = TC_POLICE_PIPE; - } else if (strcmp(*argv, "conform-exceed") == 0) { + } else if (strcmp(*argv, "action") == 0 || + strcmp(*argv, "conform-exceed") == 0) { NEXT_ARG(); if (get_police_result(&p.action, &presult, *argv)) { fprintf(stderr, "Illegal \"action\"\n");