PROTO_ROUTE6=
json_init
json_add_int action 0
- json_add_string "ifname" "$ifname"
+ [ -n "$ifname" -a "*" != "$ifname" ] && json_add_string "ifname" "$ifname"
json_add_boolean "link-up" "$up"
[ -n "$3" ] && json_add_boolean "address-external" "$external"
}
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);