G_PARAM_READWRITE |
G_PARAM_STATIC_STRINGS));
+ /* ---ifcfg-rh---
+ * property: dad-timeout
+ * variable: ARPING_WAIT
+ * default: missing variable means global default (config override or 3)
+ * description: Timeout (in seconds) for performing DAD before configuring
+ * IPv4 addresses. 0 turns off the DAD completely, -1 means default value.
+ * example: ARPING_WAIT=2
+ * ---end---
+ */
+
/**
* NMSettingIP4Config:dhcp-timeout:
*
shvarFile *network_ifcfg;
shvarFile *route_ifcfg;
gboolean never_default = FALSE;
+ gint64 timeout;
s_ip4 = (NMSettingIPConfig *) nm_setting_ip4_config_new ();
}
}
+ timeout = svGetValueInt64 (ifcfg, "ARPING_WAIT", 10, -1,
+ NM_SETTING_IP_CONFIG_DAD_TIMEOUT_MAX / 1000, -1);
+ g_object_set (s_ip4, NM_SETTING_IP_CONFIG_DAD_TIMEOUT,
+ (gint) (timeout <= 0 ? timeout : timeout * 1000), NULL);
+
return NM_SETTING (s_ip4);
done:
gint32 j;
guint32 i, n, num;
gint64 route_metric;
- int dhcp_timeout;
+ int timeout;
GString *searches;
gboolean success = FALSE;
gboolean fake_ip4 = FALSE;
if (value)
svSetValue (ifcfg, "DHCP_CLIENT_ID", value, FALSE);
- dhcp_timeout = nm_setting_ip4_config_get_dhcp_timeout (NM_SETTING_IP4_CONFIG (s_ip4));
- tmp = dhcp_timeout ? g_strdup_printf ("%d", dhcp_timeout) : NULL;
+ timeout = nm_setting_ip4_config_get_dhcp_timeout (NM_SETTING_IP4_CONFIG (s_ip4));
+ tmp = timeout ? g_strdup_printf ("%d", timeout) : NULL;
svSetValue (ifcfg, "IPV4_DHCP_TIMEOUT", tmp, FALSE);
g_free (tmp);
}
goto out;
}
+ timeout = nm_setting_ip_config_get_dad_timeout (s_ip4);
+ if (timeout < 0)
+ svSetValue (ifcfg, "ARPING_WAIT", NULL, FALSE);
+ else if (timeout == 0)
+ svSetValue (ifcfg, "ARPING_WAIT", "0", FALSE);
+ else {
+ /* Round the value up to next integer */
+ svSetValueInt64 (ifcfg, "ARPING_WAIT", (timeout - 1) / 1000 + 1);
+ }
+
success = TRUE;
out: