diff options
author | Felix Fietkau <nbd@openwrt.org> | 2011-10-14 00:09:16 +0200 |
---|---|---|
committer | Felix Fietkau <nbd@openwrt.org> | 2011-10-14 00:10:49 +0200 |
commit | b021a49efe0641f7c5ca763bc43e5ba73b7a1b5f (patch) | |
tree | 17170da43493b3e47b559180611bf69e1d0f5825 /proto-shell.c | |
parent | cb0aeee156725940b4123bd828a831e96cae012f (diff) | |
download | netifd-b021a49efe0641f7c5ca763bc43e5ba73b7a1b5f.tar.gz |
proto-shell: allow proto setups without ifname (if interface main dev is present)
Diffstat (limited to 'proto-shell.c')
-rw-r--r-- | proto-shell.c | 8 |
1 files changed, 4 insertions, 4 deletions
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); |