]> git.proxmox.com Git - mirror_iproute2.git/commitdiff
Protocol field on tc_filter is required
authorStephen Hemminger <stephen.hemminger@vyatta.com>
Fri, 8 Feb 2008 03:25:26 +0000 (19:25 -0800)
committerStephen Hemminger <stephen.hemminger@vyatta.com>
Fri, 8 Feb 2008 03:25:26 +0000 (19:25 -0800)
Kernel won't find matching filter if protocol value not
provided.

tc/tc_filter.c

index a9ae424a1f68445dccdbbf4741e6fee4e1e3d8f0..d70c656dcfe561757a91c284d5e16c9e5523d916 100644 (file)
@@ -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])