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:
@@ -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;
|
||||
}
|
||||
|
Reference in New Issue
Block a user