summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorThomas Haller <thaller@redhat.com>2017-01-14 12:51:01 +0100
committerThomas Haller <thaller@redhat.com>2017-01-16 17:24:36 +0100
commitf0cd2403d4bd16168c1e43e367e2e8e9b8297d55 (patch)
tree729ad39b6d67237d8996f4983235d14e5da0b3f2
parent2802e823fc6b8618aada9f52ccc93137dfd5d16d (diff)
device: fix sysctl getter for MTU using guint32 type
The only caller wants to read the MTU, which is more type guint32 then gint32.
-rw-r--r--src/devices/nm-device.c11
1 files changed, 8 insertions, 3 deletions
diff --git a/src/devices/nm-device.c b/src/devices/nm-device.c
index fe5e930e41..0cd5007ee6 100644
--- a/src/devices/nm-device.c
+++ b/src/devices/nm-device.c
@@ -643,9 +643,14 @@ nm_device_ipv6_sysctl_set (NMDevice *self, const char *property, const char *val
}
static guint32
-nm_device_ipv6_sysctl_get_int32 (NMDevice *self, const char *property, gint32 fallback)
+nm_device_ipv6_sysctl_get_uint32 (NMDevice *self, const char *property, guint32 fallback)
{
- return nm_platform_sysctl_get_int32 (NM_PLATFORM_GET, NMP_SYSCTL_PATHID_ABSOLUTE (nm_utils_ip6_property_path (nm_device_get_ip_iface (self), property)), fallback);
+ return nm_platform_sysctl_get_int_checked (NM_PLATFORM_GET,
+ NMP_SYSCTL_PATHID_ABSOLUTE (nm_utils_ip6_property_path (nm_device_get_ip_iface (self), property)),
+ 10,
+ 0,
+ G_MAXUINT32,
+ fallback);
}
gboolean
@@ -6635,7 +6640,7 @@ nm_device_ipv6_set_mtu (NMDevice *self, guint32 mtu)
{
NMDevicePrivate *priv = NM_DEVICE_GET_PRIVATE (self);
guint32 ip_mtu = get_ip_mtu (self);
- guint32 plat_mtu = nm_device_ipv6_sysctl_get_int32 (self, "mtu", ip_mtu);
+ guint32 plat_mtu = nm_device_ipv6_sysctl_get_uint32 (self, "mtu", ip_mtu);
priv->ip6_mtu = mtu ?: plat_mtu;