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.
This commit is contained in:
Beniamino Galvani 2016-02-05 08:47:38 +01:00
parent 206e074863
commit 1bb3b6a4c6
3 changed files with 9 additions and 9 deletions

View file

@ -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,

View file

@ -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));
}

View file

@ -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);