device: apply settings when existing device becomes external
authorHans Dedecker <dedeckeh@gmail.com>
Tue, 1 Sep 2015 12:43:57 +0000 (14:43 +0200)
committerFelix Fietkau <nbd@openwrt.org>
Wed, 2 Sep 2015 15:29:51 +0000 (17:29 +0200)
Make sure device settings are applied when existing device becomes external

Signed-off-by: Hans Dedecker <dedeckeh@gmail.com>
device.c

index 4a8db70477b2c7b2a97523f552e087b5bf13b0ae..0d7313887a227051ba3b37b867f8bbe476a476d0 100644 (file)
--- a/device.c
+++ b/device.c
@@ -446,6 +446,7 @@ device_get(const char *name, int create)
        dev = avl_find_element(&devices, name, dev, avl);
        if (dev) {
                if (create > 1 && !dev->external) {
+                       system_if_apply_settings(dev, &dev->settings, dev->settings.flags);
                        dev->external = true;
                        device_set_present(dev, true);
                }