Disallow all notifications from the proto handler during teardown to
avoid the shell proto state being reset to S_IDLE and the interface
hanging in IFS_TEARDOWN state.
Signed-off-by: Steven Barth <steven@midlink.org>
return UBUS_STATUS_INVALID_ARGUMENT;
up = blobmsg_get_bool(tb[NOTIFY_LINK_UP]);
- if (!up || state->sm == S_TEARDOWN) {
+ if (!up) {
state->proto.proto_event(&state->proto, IFPEV_LINK_LOST);
return 0;
}
if (!tb[NOTIFY_ACTION])
return UBUS_STATUS_INVALID_ARGUMENT;
+ if (state->sm == S_TEARDOWN || state->sm == S_SETUP_ABORT)
+ return UBUS_STATUS_PERMISSION_DENIED;
+
switch(blobmsg_get_u32(tb[NOTIFY_ACTION])) {
case 0:
return proto_shell_update_link(state, attr, tb);