summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorThomas Haller <thaller@redhat.com>2019-05-01 08:20:42 +0200
committerThomas Haller <thaller@redhat.com>2019-05-07 20:58:17 +0200
commita1099a1fab661a430fa8e8015369b536c806433e (patch)
tree582a66f85a70382b37719cc01414f2db5d19915a
parent47d8bee1130c619a41fe64753d88d88012f9fb98 (diff)
downloadNetworkManager-a1099a1fab661a430fa8e8015369b536c806433e.tar.gz
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.
-rw-r--r--src/platform/nm-linux-platform.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/src/platform/nm-linux-platform.c b/src/platform/nm-linux-platform.c
index a11ebcc163..290c31ad13 100644
--- a/src/platform/nm-linux-platform.c
+++ b/src/platform/nm-linux-platform.c
@@ -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);