mirror of
https://gitlab.freedesktop.org/NetworkManager/NetworkManager.git
synced 2026-01-04 04:00:17 +01:00
ifcfg-rh: add support for gateway ping timeout
This commit is contained in:
parent
7c2abb2c9f
commit
d687492d49
2 changed files with 23 additions and 0 deletions
|
|
@ -228,6 +228,21 @@ make_connection_setting (const char *file,
|
|||
g_free (value);
|
||||
}
|
||||
|
||||
value = svGetValue (ifcfg, "GATEWAY_PING_TIMEOUT", FALSE);
|
||||
if (value) {
|
||||
long int tmp;
|
||||
guint32 timeout;
|
||||
|
||||
errno = 0;
|
||||
tmp = strtol (value, NULL, 10);
|
||||
if (errno == 0 && tmp >= 0 && tmp < G_MAXINT32) {
|
||||
timeout = (guint32) tmp;
|
||||
g_object_set (s_con, NM_SETTING_CONNECTION_GATEWAY_PING_TIMEOUT, timeout, NULL);
|
||||
} else
|
||||
PLUGIN_WARN (IFCFG_PLUGIN_NAME, " warning: invalid GATEWAY_PING_TIMEOUT time");
|
||||
g_free (value);
|
||||
}
|
||||
|
||||
return NM_SETTING (s_con);
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -1430,6 +1430,7 @@ write_connection_setting (NMSettingConnection *s_con, shvarFile *ifcfg)
|
|||
guint32 n, i;
|
||||
GString *str;
|
||||
const char *master;
|
||||
char *tmp;
|
||||
|
||||
svSetValue (ifcfg, "NAME", nm_setting_connection_get_id (s_con), FALSE);
|
||||
svSetValue (ifcfg, "UUID", nm_setting_connection_get_uuid (s_con), FALSE);
|
||||
|
|
@ -1491,6 +1492,13 @@ write_connection_setting (NMSettingConnection *s_con, shvarFile *ifcfg)
|
|||
svSetValue (ifcfg, "SECONDARY_UUIDS", str->str, FALSE);
|
||||
g_string_free (str, TRUE);
|
||||
}
|
||||
|
||||
svSetValue (ifcfg, "GATEWAY_PING_TIMEOUT", NULL, FALSE);
|
||||
if (nm_setting_connection_get_gateway_ping_timeout (s_con)) {
|
||||
tmp = g_strdup_printf ("%" G_GUINT32_FORMAT, nm_setting_connection_get_gateway_ping_timeout (s_con));
|
||||
svSetValue (ifcfg, "GATEWAY_PING_TIMEOUT", tmp, FALSE);
|
||||
g_free (tmp);
|
||||
}
|
||||
}
|
||||
|
||||
static gboolean
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue