diff options
author | Beniamino Galvani <bgalvani@redhat.com> | 2016-02-05 08:47:38 +0100 |
---|---|---|
committer | Beniamino Galvani <bgalvani@redhat.com> | 2016-02-16 11:37:26 +0100 |
commit | 1bb3b6a4c62e61b02b5a0c06a73f6ff2177ca3ed (patch) | |
tree | 64d6616dc6a4ca5d0df7e8cdf20ae8c248e42cf4 | |
parent | 206e0748638b160700ae26c81990e0dfc26644ee (diff) | |
download | NetworkManager-1bb3b6a4c62e61b02b5a0c06a73f6ff2177ca3ed.tar.gz |
libnm-core: make ipvx.dhcp-timeout signed
Change the dhcp-timeout property in NMSettingIPConfig to int type for
consistency with the dad-timeout property. For dad-timeout -1 means
"use default value", while for dhcp-timeout probably we will never use
negative values, but it seems more correct to use the same type for
the two properties.
-rw-r--r-- | clients/cli/settings.c | 2 | ||||
-rw-r--r-- | libnm-core/nm-setting-ip-config.c | 14 | ||||
-rw-r--r-- | src/settings/plugins/ifcfg-rh/reader.c | 2 |
3 files changed, 9 insertions, 9 deletions
diff --git a/clients/cli/settings.c b/clients/cli/settings.c index 51ac2ff860..c341ce72d2 100644 --- a/clients/cli/settings.c +++ b/clients/cli/settings.c @@ -6462,7 +6462,7 @@ nmc_properties_init (void) NULL); nmc_add_prop_funcs (GLUE_IP (4, DHCP_TIMEOUT), nmc_property_ipv4_get_dhcp_timeout, - nmc_property_set_uint, + nmc_property_set_int, NULL, NULL, NULL, diff --git a/libnm-core/nm-setting-ip-config.c b/libnm-core/nm-setting-ip-config.c index 9db10a3ba9..5454b4dbb7 100644 --- a/libnm-core/nm-setting-ip-config.c +++ b/libnm-core/nm-setting-ip-config.c @@ -2391,7 +2391,7 @@ set_property (GObject *object, guint prop_id, priv->dad_timeout = g_value_get_int (value); break; case PROP_DHCP_TIMEOUT: - priv->dhcp_timeout = g_value_get_uint (value); + priv->dhcp_timeout = g_value_get_int (value); break; default: G_OBJECT_WARN_INVALID_PROPERTY_ID (object, prop_id, pspec); @@ -2457,7 +2457,7 @@ get_property (GObject *object, guint prop_id, g_value_set_int (value, nm_setting_ip_config_get_dad_timeout (setting)); break; case PROP_DHCP_TIMEOUT: - g_value_set_uint (value, nm_setting_ip_config_get_dhcp_timeout (setting)); + g_value_set_int (value, nm_setting_ip_config_get_dhcp_timeout (setting)); break; default: G_OBJECT_WARN_INVALID_PROPERTY_ID (object, prop_id, pspec); @@ -2768,9 +2768,9 @@ nm_setting_ip_config_class_init (NMSettingIPConfigClass *setting_class) **/ g_object_class_install_property (object_class, PROP_DHCP_TIMEOUT, - g_param_spec_uint (NM_SETTING_IP_CONFIG_DHCP_TIMEOUT, "", "", - 0, G_MAXUINT32, 0, - G_PARAM_READWRITE | - NM_SETTING_PARAM_FUZZY_IGNORE | - G_PARAM_STATIC_STRINGS)); + g_param_spec_int (NM_SETTING_IP_CONFIG_DHCP_TIMEOUT, "", "", + 0, G_MAXINT32, 0, + G_PARAM_READWRITE | + NM_SETTING_PARAM_FUZZY_IGNORE | + G_PARAM_STATIC_STRINGS)); } diff --git a/src/settings/plugins/ifcfg-rh/reader.c b/src/settings/plugins/ifcfg-rh/reader.c index 9ce1458790..0f79ca07aa 100644 --- a/src/settings/plugins/ifcfg-rh/reader.c +++ b/src/settings/plugins/ifcfg-rh/reader.c @@ -1040,7 +1040,7 @@ make_ip4_setting (shvarFile *ifcfg, g_object_set (s_ip4, NM_SETTING_IP_CONFIG_DHCP_SEND_HOSTNAME, svGetValueBoolean (ifcfg, "DHCP_SEND_HOSTNAME", TRUE), - NM_SETTING_IP_CONFIG_DHCP_TIMEOUT, svGetValueInt64 (ifcfg, "IPV4_DHCP_TIMEOUT", 10, 0, G_MAXUINT32, 0), + NM_SETTING_IP_CONFIG_DHCP_TIMEOUT, svGetValueInt64 (ifcfg, "IPV4_DHCP_TIMEOUT", 10, 0, G_MAXINT32, 0), NULL); value = svGetValue (ifcfg, "DHCP_CLIENT_ID", FALSE); |