diff --git a/tc/tc_filter.c b/tc/tc_filter.c index a9ae424a..d70c656d 100644 --- a/tc/tc_filter.c +++ b/tc/tc_filter.c @@ -31,7 +31,7 @@ static void usage(void); static void usage(void) { fprintf(stderr, "Usage: tc filter [ add | del | change | replace | show ] dev STRING\n"); - fprintf(stderr, " [ pref PRIO ] [ protocol PROTO ]\n"); + fprintf(stderr, " [ pref PRIO ] protocol PROTO\n"); fprintf(stderr, " [ estimator INTERVAL TIME_CONSTANT ]\n"); fprintf(stderr, " [ root | classid CLASSID ] [ handle FILTERID ]\n"); fprintf(stderr, " [ [ FILTER_TYPE ] [ help | OPTIONS ] ]\n"); @@ -102,7 +102,7 @@ int tc_filter_modify(int cmd, unsigned flags, int argc, char **argv) if (prio) duparg("priority", *argv); if (get_u32(&prio, *argv, 0)) - invarg(*argv, "invalid prpriority value"); + invarg(*argv, "invalid priority value"); } else if (matches(*argv, "protocol") == 0) { __u16 id; NEXT_ARG(); @@ -127,6 +127,11 @@ int tc_filter_modify(int cmd, unsigned flags, int argc, char **argv) argc--; argv++; } + if (!protocol) { + fprintf(stderr, "\"protocol\" is required.\n"); + return -1; + } + req.t.tcm_info = TC_H_MAKE(prio<<16, protocol); if (k[0])