mirror of
https://gitlab.freedesktop.org/NetworkManager/NetworkManager.git
synced 2026-05-08 22:58:16 +02:00
device: avoid platform assertion failure
Avoid the following: nmp_cache_lookup_entry_link: assertion 'ifindex > 0' failed
This commit is contained in:
parent
92e57ab292
commit
84f9c9489b
1 changed files with 5 additions and 2 deletions
|
|
@ -3465,11 +3465,14 @@ nm_device_set_carrier (NMDevice *self, gboolean carrier)
|
||||||
static void
|
static void
|
||||||
nm_device_set_carrier_from_platform (NMDevice *self)
|
nm_device_set_carrier_from_platform (NMDevice *self)
|
||||||
{
|
{
|
||||||
|
int ifindex;
|
||||||
|
|
||||||
if (nm_device_has_capability (self, NM_DEVICE_CAP_CARRIER_DETECT)) {
|
if (nm_device_has_capability (self, NM_DEVICE_CAP_CARRIER_DETECT)) {
|
||||||
if (!nm_device_has_capability (self, NM_DEVICE_CAP_NONSTANDARD_CARRIER)) {
|
if ( !nm_device_has_capability (self, NM_DEVICE_CAP_NONSTANDARD_CARRIER)
|
||||||
|
&& (ifindex = nm_device_get_ip_ifindex (self)) > 0) {
|
||||||
nm_device_set_carrier (self,
|
nm_device_set_carrier (self,
|
||||||
nm_platform_link_is_connected (nm_device_get_platform (self),
|
nm_platform_link_is_connected (nm_device_get_platform (self),
|
||||||
nm_device_get_ip_ifindex (self)));
|
ifindex));
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
NMDevicePrivate *priv = NM_DEVICE_GET_PRIVATE (self);
|
NMDevicePrivate *priv = NM_DEVICE_GET_PRIVATE (self);
|
||||||
|
|
|
||||||
Loading…
Add table
Reference in a new issue