diff options
Diffstat (limited to 'device.c')
-rw-r--r-- | device.c | 8 |
1 files changed, 8 insertions, 0 deletions
@@ -62,6 +62,14 @@ void device_unlock(void) static int set_device_state(struct device *dev, bool state) { + if (state) { + /* Set ifindex for all devices being enabled so a valid */ + /* ifindex is in place avoiding possible race conditions */ + device_set_ifindex(dev, system_if_resolve(dev)); + if (!dev->ifindex) + return -1; + } + if (dev->external) return 0; |