htb: fix misplaced memset() overwriting already set htb prio option

Reported by Richard Cesar <spidla@spidlas.cz>
This commit is contained in:
Thomas Graf 2011-08-12 13:47:23 +02:00
parent cc9ae9b34b
commit 4be7adbb71

View file

@ -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);