+ if (addr_ext)
+ dev_create = 2;
+ }
+
+ if (iface->state != IFS_UP || !iface->l3_dev.dev)
+ keep = false;
+
+ if (!keep) {
+ dev = iface->main_dev.dev;
+ if (tb[NOTIFY_IFNAME]) {
+ keep = false;
+ devname = blobmsg_data(tb[NOTIFY_IFNAME]);
+ if (tb[NOTIFY_TUNNEL])
+ dev = proto_shell_create_tunnel(devname, tb[NOTIFY_TUNNEL]);
+ else
+ dev = device_get(devname, dev_create);
+ }
+
+ if (!dev)
+ return UBUS_STATUS_INVALID_ARGUMENT;
+
+ interface_set_l3_dev(iface, dev);
+ device_claim(&iface->l3_dev);
+ device_set_present(dev, true);
+
+ interface_update_start(iface);
+ }
+
+ proto_apply_ip_settings(iface, data, addr_ext);
+
+ if ((cur = tb[NOTIFY_ROUTES]) != NULL)
+ proto_shell_parse_route_list(state->proto.iface, cur, false);
+
+ if ((cur = tb[NOTIFY_ROUTES6]) != NULL)
+ proto_shell_parse_route_list(state->proto.iface, cur, true);
+
+ if ((cur = tb[NOTIFY_DNS]))
+ interface_add_dns_server_list(&iface->proto_ip, cur);
+
+ if ((cur = tb[NOTIFY_DNS_SEARCH]))
+ interface_add_dns_search_list(&iface->proto_ip, cur);