mirror of
https://gitlab.freedesktop.org/NetworkManager/NetworkManager.git
synced 2026-04-19 14:50:39 +02:00
device: avoid unnecessary check for existing device in release_slave() implementations
This commit is contained in:
parent
5f668b81d3
commit
72e604c8e4
3 changed files with 18 additions and 12 deletions
|
|
@ -416,10 +416,12 @@ release_slave (NMDevice *device,
|
|||
int ifindex_slave;
|
||||
int ifindex;
|
||||
|
||||
ifindex = nm_device_get_ifindex (device);
|
||||
if ( ifindex <= 0
|
||||
|| !nm_platform_link_get (nm_device_get_platform (device), ifindex))
|
||||
configure = FALSE;
|
||||
if (configure) {
|
||||
ifindex = nm_device_get_ifindex (device);
|
||||
if ( ifindex <= 0
|
||||
|| !nm_platform_link_get (nm_device_get_platform (device), ifindex))
|
||||
configure = FALSE;
|
||||
}
|
||||
|
||||
ifindex_slave = nm_device_get_ip_ifindex (slave);
|
||||
|
||||
|
|
|
|||
|
|
@ -628,10 +628,12 @@ release_slave (NMDevice *device,
|
|||
int ifindex_slave;
|
||||
int ifindex;
|
||||
|
||||
ifindex = nm_device_get_ifindex (device);
|
||||
if ( ifindex <= 0
|
||||
|| !nm_platform_link_get (nm_device_get_platform (device), ifindex))
|
||||
configure = FALSE;
|
||||
if (configure) {
|
||||
ifindex = nm_device_get_ifindex (device);
|
||||
if ( ifindex <= 0
|
||||
|| !nm_platform_link_get (nm_device_get_platform (device), ifindex))
|
||||
configure = FALSE;
|
||||
}
|
||||
|
||||
ifindex_slave = nm_device_get_ip_ifindex (slave);
|
||||
|
||||
|
|
|
|||
|
|
@ -777,10 +777,12 @@ release_slave (NMDevice *device,
|
|||
int ifindex_slave;
|
||||
int ifindex;
|
||||
|
||||
ifindex = nm_device_get_ifindex (device);
|
||||
if ( ifindex <= 0
|
||||
|| !nm_platform_link_get (nm_device_get_platform (device), ifindex))
|
||||
configure = FALSE;
|
||||
if (configure) {
|
||||
ifindex = nm_device_get_ifindex (device);
|
||||
if ( ifindex <= 0
|
||||
|| !nm_platform_link_get (nm_device_get_platform (device), ifindex))
|
||||
configure = FALSE;
|
||||
}
|
||||
|
||||
ifindex_slave = nm_device_get_ip_ifindex (slave);
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue