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.)
This commit is contained in:
Dan Winship
2014-02-20 14:23:06 -05:00
parent 255cc3f707
commit 95cf36fa8b

View File

@@ -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->remote = nla_get_u32 (tb[IFLA_GRE_REMOTE]);
props->tos = nla_get_u8 (tb[IFLA_GRE_TOS]); props->tos = nla_get_u8 (tb[IFLA_GRE_TOS]);
props->ttl = nla_get_u8 (tb[IFLA_GRE_TTL]); 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; return 0;
} }