From 95cf36fa8b5912b9333bce99eb4e20a01ff632fe Mon Sep 17 00:00:00 2001 From: Dan Winship Date: Thu, 20 Feb 2014 14:23:06 -0500 Subject: [PATCH] platform: sanitize a boolean property Make sure NMPlatformGreProperties->path_mtu_discovery is always TRUE or FALSE, even if the value from the kernel is "2" or "16" or something. (This makes it consistent with what we do for other boolean netlink properties.) --- src/platform/nm-linux-platform.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/platform/nm-linux-platform.c b/src/platform/nm-linux-platform.c index dde01c2019..59967b1894 100644 --- a/src/platform/nm-linux-platform.c +++ b/src/platform/nm-linux-platform.c @@ -2281,7 +2281,7 @@ gre_info_data_parser (struct nlattr *info_data, gpointer parser_data) props->remote = nla_get_u32 (tb[IFLA_GRE_REMOTE]); props->tos = nla_get_u8 (tb[IFLA_GRE_TOS]); props->ttl = nla_get_u8 (tb[IFLA_GRE_TTL]); - props->path_mtu_discovery = nla_get_u8 (tb[IFLA_GRE_PMTUDISC]); + props->path_mtu_discovery = !!nla_get_u8 (tb[IFLA_GRE_PMTUDISC]); return 0; }