netifd: Check interface state only when main device is set during interface_change_config
authorHans Dedecker <dedeckeh@gmail.com>
Wed, 7 May 2014 09:19:08 +0000 (09:19 +0000)
committerSteven Barth <steven@midlink.org>
Fri, 9 May 2014 13:50:33 +0000 (15:50 +0200)
Fixes a regression issue introduced by commit d2a33f3f0fe704e4396fa2ada08401cb955ba7cb for device less protocol handlers.
An active interface using a deviceless protocol handler will be be teared down when the interface config is checked upon
an update as the interface link and enabled parameters are unset as no underlying device is present (eg tunnel interfaces)

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

index 95e1ee8f3d7316b3325f866878dd0183d8af47c1..a4d7b8de2dee7cafe4157d8cabbaf2472337030a 100644 (file)
@@ -1020,7 +1020,8 @@ interface_change_config(struct interface *if_old, struct interface *if_new)
        }
 
        interface_write_resolv_conf();
-       interface_check_state(if_old);
+       if (if_old->main_dev.dev)
+               interface_check_state(if_old);
 
 out:
        if_new->config = NULL;