device: fall back to simple interface status check if not provided by the device...
[project/netifd.git] / device.c
index f484c28..b16f156 100644 (file)
--- a/device.c
+++ b/device.c
@@ -61,6 +61,9 @@ void device_unlock(void)
 
 static int set_device_state(struct device *dev, bool state)
 {
+       if (dev->external)
+               return 0;
+
        if (state)
                system_if_up(dev);
        else
@@ -259,7 +262,7 @@ void device_release(struct device_user *dep)
 int device_check_state(struct device *dev)
 {
        if (!dev->type->check_state)
-               return 0;
+               return simple_device_type.check_state(dev);
 
        return dev->type->check_state(dev);
 }