mirror of
https://gitlab.freedesktop.org/NetworkManager/NetworkManager.git
synced 2026-01-06 02:40:17 +01:00
ifcfg-rh: reorder checks in nm_ifcfg_connection_check_devtimeout()
Move the check for a platform link before devtimeout_from_file(). The check in the platform cache should be more performant and yield success in most cases. This can save reading and parsing the ifcfg-rh file.
This commit is contained in:
parent
ecdf7cba6b
commit
6608331aec
1 changed files with 4 additions and 3 deletions
|
|
@ -162,14 +162,15 @@ nm_ifcfg_connection_check_devtimeout (NMIfcfgConnection *self)
|
|||
filename = nm_settings_connection_get_filename (NM_SETTINGS_CONNECTION (self));
|
||||
if (!filename)
|
||||
return;
|
||||
devtimeout = devtimeout_from_file (filename);
|
||||
if (!devtimeout)
|
||||
return;
|
||||
|
||||
pllink = nm_platform_link_get_by_ifname (NM_PLATFORM_GET, ifname);
|
||||
if (pllink && pllink->initialized)
|
||||
return;
|
||||
|
||||
devtimeout = devtimeout_from_file (filename);
|
||||
if (!devtimeout)
|
||||
return;
|
||||
|
||||
/* ONBOOT=yes, DEVICE and DEVTIMEOUT are set, but device is not present */
|
||||
nm_settings_connection_set_ready (NM_SETTINGS_CONNECTION (self), FALSE);
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue