X-Git-Url: http://git.archive.openwrt.org/?p=project%2Fnetifd.git;a=blobdiff_plain;f=proto-shell.c;h=f5a5fb14b88e1c861ec58b72b52b9a773b6bc02e;hp=fdb87df4e5bc939cda34062706ca09ed2c2f9838;hb=b021a49efe0641f7c5ca763bc43e5ba73b7a1b5f;hpb=cb0aeee156725940b4123bd828a831e96cae012f diff --git a/proto-shell.c b/proto-shell.c index fdb87df..f5a5fb1 100644 --- a/proto-shell.c +++ b/proto-shell.c @@ -351,10 +351,10 @@ proto_shell_update_link(struct proto_shell_state *state, struct blob_attr **tb) return 0; } - if (!tb[NOTIFY_IFNAME]) - return UBUS_STATUS_INVALID_ARGUMENT; - - if (!state->l3_dev.dev) { + if (!tb[NOTIFY_IFNAME]) { + if (!state->iface->main_dev.dev) + return UBUS_STATUS_INVALID_ARGUMENT; + } else if (!state->l3_dev.dev) { device_add_user(&state->l3_dev, device_get(blobmsg_data(tb[NOTIFY_IFNAME]), true)); device_claim(&state->l3_dev);