]> git.ipfire.org Git - thirdparty/iproute2.git/commitdiff
Fix tc pfifo_fast with options
authorshemminger <shemminger>
Fri, 7 Oct 2005 16:33:21 +0000 (16:33 +0000)
committershemminger <shemminger>
Fri, 7 Oct 2005 16:33:21 +0000 (16:33 +0000)
ChangeLog
tc/tc.c
tc/tc_qdisc.c

index 4a50ffa6e3a1bbf774622e7d8528b6402f8b6afe..e663fe603ca9ce277bc27eb9acee93415da0dc22 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,7 @@
+2005-10-07  Mike Frysinger <vapier@gentoo.org>
+
+       * Handle pfifo_fast that has no qopt without segfaulting
+
 2005-10-05  Mads Martin Joergensen <mmj@suse.de>
 
        * Trivial netem ccopts
diff --git a/tc/tc.c b/tc/tc.c
index 16d6c795bde03735cb756fc4b6760731bd97377e..fa36ee076d8c735d49c4a4a1a1c00a5528a6dea7 100644 (file)
--- a/tc/tc.c
+++ b/tc/tc.c
@@ -38,7 +38,7 @@ int use_iec = 0;
 int force = 0;
 struct rtnl_handle rth;
 
-static void *BODY;     /* cached handle dlopen(NULL) */
+static void *BODY = NULL;      /* cached handle dlopen(NULL) */
 static struct qdisc_util * qdisc_list;
 static struct filter_util * filter_list;
 
index 7802d528fedddfad82024d28e521f9007efc61ed..e9174abf4efb7dc52a9261816cde7dd0028e4dfa 100644 (file)
@@ -126,6 +126,10 @@ int tc_qdisc_modify(int cmd, unsigned flags, int argc, char **argv)
                addattr_l(&req.n, sizeof(req), TCA_RATE, &est, sizeof(est));
 
        if (q) {
+               if (!q->parse_qopt) {
+                       fprintf(stderr, "qdisc '%s' does not support option parsing\n", k);
+                       return -1;
+               }
                if (q->parse_qopt(q, argc, argv, &req.n))
                        return 1;
        } else {