Make sure BODY is initialized before we use it and make sure the specified q_disc supports option parsing before calling parse_qopt() http://bugs.gentoo.org/108307 --- tc/tc.c +++ tc/tc.c @@ -38,7 +38,7 @@ 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; --- tc/tc_qdisc.c +++ tc/tc_qdisc.c @@ -126,6 +126,10 @@ 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 {