Commit a1099a1f authored by Thomas Haller's avatar Thomas Haller

platform: use u32 netlink type for TCA_FQ_CODEL_ECN

In practice, there is no difference when representing 0 or 1 as signed/unsigned 32
bit integer. But still use the correct type that also kernel uses.

Also, the implicit conversation from uint32 to bool was correct already.
Still, explicitly convert the uint32 value to boolean in _new_from_nl_qdisc().
It's no change in behavior.
parent 47d8bee1
......@@ -3547,7 +3547,7 @@ _new_from_nl_qdisc (struct nlmsghdr *nlh, gboolean id_only)
obj->qdisc.fq_codel.memory = nla_get_u32 (options_attr);
break;
case TCA_FQ_CODEL_ECN:
obj->qdisc.fq_codel.ecn = nla_get_u32 (options_attr);
obj->qdisc.fq_codel.ecn = !!nla_get_u32 (options_attr);
break;
}
}
......@@ -4244,7 +4244,7 @@ _nl_msg_new_qdisc (int nlmsg_type,
if (qdisc->fq_codel.memory != -1)
NLA_PUT_U32 (msg, TCA_FQ_CODEL_MEMORY_LIMIT, qdisc->fq_codel.memory);
if (qdisc->fq_codel.ecn)
NLA_PUT_S32 (msg, TCA_FQ_CODEL_ECN, qdisc->fq_codel.ecn);
NLA_PUT_U32 (msg, TCA_FQ_CODEL_ECN, qdisc->fq_codel.ecn);
}
nla_nest_end (msg, tc_options);
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment