device: assert we're not waiting on a nil master

If we're notified of a master appearing, make sure there's actually an
ifindex we're waiting for.

Triger an assertion failure if that is not the case, cause that's pretty
messed up.
This commit is contained in:
Lubomir Rintel 2022-09-30 17:49:32 +02:00
parent bf60fd5acc
commit 455dbfce6e

View file

@ -6608,6 +6608,8 @@ device_ifindex_changed_cb(NMManager *manager, NMDevice *device_changed, NMDevice
{
NMDevicePrivate *priv = NM_DEVICE_GET_PRIVATE(self);
g_return_if_fail(priv->master_ifindex > 0);
if (priv->master_ifindex != nm_device_get_ifindex(device_changed))
return;