]> git.ipfire.org Git - thirdparty/iproute2.git/commitdiff
Fix GRED options clearing
authorStephen Hemminger <stephen.hemminger@vyatta.com>
Wed, 25 Aug 2010 16:04:55 +0000 (09:04 -0700)
committerStephen Hemminger <stephen.hemminger@vyatta.com>
Wed, 25 Aug 2010 16:04:55 +0000 (09:04 -0700)
Bug reported where priorities of GRED DP's are ignored.
The option parsing sets opt then memset was clearing these
values.

tc/q_gred.c

index df4aa3d8a65b5cf1bcbdb19f04fe80a8bdb04706..59651d362bb4800b620ea67b879534ba4656a569 100644 (file)
@@ -51,7 +51,7 @@ static int init_gred(struct qdisc_util *qu, int argc, char **argv,
 {
 
        struct rtattr *tail;
-       struct tc_gred_sopt opt;
+       struct tc_gred_sopt opt = { 0 };
        int dps = 0;
        int def_dp = -1;
 
@@ -83,7 +83,7 @@ static int init_gred(struct qdisc_util *qu, int argc, char **argv,
                                return -1;
                        }
                } else if (strcmp(*argv, "grio") == 0) {
-                       opt.grio=1;
+                       opt.grio = 1;
                } else if (strcmp(*argv, "help") == 0) {
                        explain();
                        return -1;
@@ -100,7 +100,6 @@ static int init_gred(struct qdisc_util *qu, int argc, char **argv,
                return -1;
        }
 
-       memset(&opt, 0, sizeof(struct tc_gred_sopt));
        opt.DPs = dps;
        opt.def_DP = def_dp;