Protocol field on tc_filter is required
Kernel won't find matching filter if protocol value not provided.
This commit is contained in:
parent
10bd7e8460
commit
de33a43055
|
|
@ -31,7 +31,7 @@ static void usage(void);
|
||||||
static void usage(void)
|
static void usage(void)
|
||||||
{
|
{
|
||||||
fprintf(stderr, "Usage: tc filter [ add | del | change | replace | show ] dev STRING\n");
|
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, " [ estimator INTERVAL TIME_CONSTANT ]\n");
|
||||||
fprintf(stderr, " [ root | classid CLASSID ] [ handle FILTERID ]\n");
|
fprintf(stderr, " [ root | classid CLASSID ] [ handle FILTERID ]\n");
|
||||||
fprintf(stderr, " [ [ FILTER_TYPE ] [ help | OPTIONS ] ]\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)
|
if (prio)
|
||||||
duparg("priority", *argv);
|
duparg("priority", *argv);
|
||||||
if (get_u32(&prio, *argv, 0))
|
if (get_u32(&prio, *argv, 0))
|
||||||
invarg(*argv, "invalid prpriority value");
|
invarg(*argv, "invalid priority value");
|
||||||
} else if (matches(*argv, "protocol") == 0) {
|
} else if (matches(*argv, "protocol") == 0) {
|
||||||
__u16 id;
|
__u16 id;
|
||||||
NEXT_ARG();
|
NEXT_ARG();
|
||||||
|
|
@ -127,6 +127,11 @@ int tc_filter_modify(int cmd, unsigned flags, int argc, char **argv)
|
||||||
argc--; argv++;
|
argc--; argv++;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (!protocol) {
|
||||||
|
fprintf(stderr, "\"protocol\" is required.\n");
|
||||||
|
return -1;
|
||||||
|
}
|
||||||
|
|
||||||
req.t.tcm_info = TC_H_MAKE(prio<<16, protocol);
|
req.t.tcm_info = TC_H_MAKE(prio<<16, protocol);
|
||||||
|
|
||||||
if (k[0])
|
if (k[0])
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue