summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorThomas Haller <thaller@redhat.com>2019-05-01 08:20:42 +0200
committerLubomir Rintel <lkundrak@v3.sk>2019-05-15 14:07:07 +0200
commitef2b660bb8cb2c30faf55c51a411e8a757707076 (patch)
tree0bb6288b3ab6397ec60cff6badf3a5802bcfcb9b
parent366d3af00960803c973a307a6bd7ffeedd9c1520 (diff)
downloadNetworkManager-ef2b660bb8cb2c30faf55c51a411e8a757707076.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. (cherry picked from commit a1099a1fab661a430fa8e8015369b536c806433e)
-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 6064d89eb6..1428778e03 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);