mirror of
https://gitlab.freedesktop.org/NetworkManager/NetworkManager.git
synced 2025-12-25 07:10:07 +01:00
ifcfg-rh: limit reading GATEWAY_PING_TIMEOUT to 600 seconds
libnm-core limits the rande for GATEWAY_PING_TIMEOUT to 0 to 600.
See commit e86f8354a7, "device: restart
ping process when it exits with an error".
The reader must not pass value out of range to g_object_set().
Clamp and warn.
This commit is contained in:
parent
ab1e672a21
commit
d1a58fbfbf
1 changed files with 6 additions and 2 deletions
|
|
@ -249,9 +249,13 @@ make_connection_setting (const char *file,
|
|||
gint64 tmp;
|
||||
|
||||
tmp = _nm_utils_ascii_str_to_int64 (v, 10, 0, G_MAXINT32 - 1, -1);
|
||||
if (tmp >= 0)
|
||||
if (tmp >= 0) {
|
||||
if (tmp > 600) {
|
||||
tmp = 600;
|
||||
PARSE_WARNING ("invalid GATEWAY_PING_TIMEOUT time");
|
||||
}
|
||||
g_object_set (s_con, NM_SETTING_CONNECTION_GATEWAY_PING_TIMEOUT, (guint) tmp, NULL);
|
||||
else
|
||||
} else
|
||||
PARSE_WARNING ("invalid GATEWAY_PING_TIMEOUT time");
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue