diff options
author | Hans Dedecker <dedeckeh@gmail.com> | 2014-10-10 13:35:08 +0000 |
---|---|---|
committer | Steven Barth <steven@midlink.org> | 2014-10-12 14:25:37 +0200 |
commit | 4210b3247c8afd9981a4534bb3cba9e30959b611 (patch) | |
tree | a3136964c239f322a9ac60858672decb3ccba4ad | |
parent | f2271a0ed9bec07c936a04b026a57e48b371132f (diff) |
netifd: Fix lost interface device config for devices having default config
As the PPP main device (either a simple or old style vlan device) is freed when PPP interfaces are reloaded; interface device specific config (eg mtu/macaddr/...) is lost as the interface config is not re-applied on the newly created device.
Patch fixes the issue by re-applying the interface device config after the main device is claimed and is having default config.
Signed-off-by: Hans Dedecker <dedeckeh@gmail.com>
-rw-r--r-- | interface.c | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/interface.c b/interface.c index 35f20b0..4543250 100644 --- a/interface.c +++ b/interface.c @@ -501,6 +501,8 @@ interface_claim_device(struct interface *iface) } else if (iface->ifname && !(iface->proto_handler->flags & PROTO_FLAG_NODEV)) { dev = device_get(iface->ifname, true); + if (dev && dev->default_config && iface->device_config) + device_set_config(dev, dev->type, iface->config); } else { dev = iface->ext_dev.dev; } @@ -881,8 +883,8 @@ interface_handle_link(struct interface *iface, const char *name, bool add, bool if (add) { device_set_present(dev, true); - if (iface->device_config) - device_set_config(dev, &simple_device_type, iface->config); + if (iface->device_config && dev->default_config) + device_set_config(dev, dev->type, iface->config); system_if_apply_settings(dev, &dev->settings, dev->settings.flags); ret = interface_add_link(iface, dev, link_ext); |