From: Thomas Graf Date: Fri, 12 Aug 2011 11:47:23 +0000 (+0200) Subject: htb: fix misplaced memset() overwriting already set htb prio option X-Git-Tag: libnl3_2~21 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=4be7adbb71b3f4f31aecb46c9dbfaa4b1fa45009;p=thirdparty%2Flibnl.git htb: fix misplaced memset() overwriting already set htb prio option Reported by Richard Cesar --- diff --git a/lib/route/qdisc/htb.c b/lib/route/qdisc/htb.c index 4417b8e..f1d0e75 100644 --- a/lib/route/qdisc/htb.c +++ b/lib/route/qdisc/htb.c @@ -217,12 +217,12 @@ static int htb_class_msg_fill(struct rtnl_tc *tc, void *data, if (!htb || !(htb->ch_mask & SCH_HTB_HAS_RATE)) BUG(); + memset(&opts, 0, sizeof(opts)); + /* if not set, zero (0) is used as priority */ if (htb->ch_mask & SCH_HTB_HAS_PRIO) opts.prio = htb->ch_prio; - memset(&opts, 0, sizeof(opts)); - mtu = rtnl_tc_get_mtu(tc); rtnl_tc_build_rate_table(tc, &htb->ch_rate, rtable);