mirror of
https://gitlab.freedesktop.org/NetworkManager/NetworkManager.git
synced 2026-01-03 15:10:14 +01:00
device: update @ip_iface only if IP interface exists
If @ip_ifindex is zero, the IP interface has disappeared and there's no point in updating @ip_iface. Actually, unconditionally updating @ip_iface is dangerous because it breaks the assumption used by other functions (as nm_device_get_ip_ifindex()) that a non-NULL @ip_iface implies a valid @ip_ifindex. This was causing the scary failure: devices/nm-device.c:666:get_ip_iface_identifier: assertion failed: (ifindex) https://bugzilla.redhat.com/show_bug.cgi?id=1268617
This commit is contained in:
parent
5f93f01015
commit
ed536998f9
1 changed files with 4 additions and 3 deletions
|
|
@ -1601,12 +1601,13 @@ device_ip_link_changed (NMDevice *self)
|
|||
{
|
||||
NMDevicePrivate *priv = NM_DEVICE_GET_PRIVATE (self);
|
||||
const NMPlatformLink *pllink;
|
||||
int ip_ifindex;
|
||||
|
||||
priv->device_ip_link_changed_id = 0;
|
||||
|
||||
ip_ifindex = nm_device_get_ip_ifindex (self);
|
||||
pllink = nm_platform_link_get (NM_PLATFORM_GET, ip_ifindex);
|
||||
if (!priv->ip_ifindex)
|
||||
return G_SOURCE_REMOVE;
|
||||
|
||||
pllink = nm_platform_link_get (NM_PLATFORM_GET, priv->ip_ifindex);
|
||||
if (!pllink)
|
||||
return G_SOURCE_REMOVE;
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue