summaryrefslogtreecommitdiffstats
path: root/lib
diff options
context:
space:
mode:
authorThomas Graf <tgraf@suug.ch>2010-10-19 11:10:26 (GMT)
committerThomas Graf <tgraf@suug.ch>2010-10-19 11:10:26 (GMT)
commitfa89403149a59ed18015713f517a5cc9356caffd (patch)
tree33f17ec4b56b451f4c40ee4e663cf79be075c969 /lib
parentc0cd587dfc46ca8e8e5f9da51e878e0678950f23 (diff)
downloadlibnl-fa89403149a59ed18015713f517a5cc9356caffd.zip
libnl-fa89403149a59ed18015713f517a5cc9356caffd.tar.gz
libnl-fa89403149a59ed18015713f517a5cc9356caffd.tar.bz2
HTB: Append TCA_OPTIONS even if no options are set
The kernel requires the TCA_OPTIONS{TCA_HTB_INIT} attribute to be present even if the default values are to be used.
Diffstat (limited to 'lib')
-rw-r--r--lib/route/sch/htb.c14
1 files changed, 7 insertions, 7 deletions
diff --git a/lib/route/sch/htb.c b/lib/route/sch/htb.c
index a167136..f45c2cf 100644
--- a/lib/route/sch/htb.c
+++ b/lib/route/sch/htb.c
@@ -232,20 +232,20 @@ static struct nl_msg *htb_qdisc_get_opts(struct rtnl_qdisc *qdisc)
struct tc_htb_glob opts;
struct nl_msg *msg;
- if (d == NULL)
- return NULL;
-
msg = nlmsg_alloc();
if (msg == NULL)
return NULL;
memset(&opts, 0, sizeof(opts));
opts.version = TC_HTB_PROTOVER;
+ opts.rate2quantum = 10;
- if (d->qh_mask & SCH_HTB_HAS_RATE2QUANTUM)
- opts.rate2quantum = d->qh_rate2quantum;
- if (d->qh_mask & SCH_HTB_HAS_DEFCLS)
- opts.defcls = d->qh_defcls;
+ if (d) {
+ if (d->qh_mask & SCH_HTB_HAS_RATE2QUANTUM)
+ opts.rate2quantum = d->qh_rate2quantum;
+ if (d->qh_mask & SCH_HTB_HAS_DEFCLS)
+ opts.defcls = d->qh_defcls;
+ }
nla_put(msg, TCA_HTB_INIT, sizeof(opts), &opts);