diff options
author | Felix Fietkau <nbd@openwrt.org> | 2012-05-14 22:45:21 +0200 |
---|---|---|
committer | Felix Fietkau <nbd@openwrt.org> | 2012-05-14 22:45:21 +0200 |
commit | 3d49dba94c7a2ebaa8626acf81ca74a22c7784f7 (patch) | |
tree | fb67402016cf5ef8245d6c029e811405fb6b1cfe /proto-shell.c | |
parent | c1726af17577aa606715ee6bed6d18fc2c5c636c (diff) |
add a command for allowing the setup task to schedule a restart
Diffstat (limited to 'proto-shell.c')
-rw-r--r-- | proto-shell.c | 18 |
1 files changed, 18 insertions, 0 deletions
diff --git a/proto-shell.c b/proto-shell.c index 6b38ee9..5309a55 100644 --- a/proto-shell.c +++ b/proto-shell.c @@ -625,6 +625,22 @@ proto_shell_add_host_dependency(struct proto_shell_state *state, struct blob_att } static int +proto_shell_setup_failed(struct proto_shell_state *state) +{ + switch (state->sm) { + case S_IDLE: + state->proto.proto_event(&state->proto, IFPEV_LINK_LOST); + /* fall through */ + case S_SETUP: + proto_shell_handler(&state->proto, PROTO_CMD_TEARDOWN, false); + break; + default: + break; + } + return 0; +} + +static int proto_shell_notify(struct interface_proto_state *proto, struct blob_attr *attr) { struct proto_shell_state *state; @@ -651,6 +667,8 @@ proto_shell_notify(struct interface_proto_state *proto, struct blob_attr *attr) return proto_shell_set_available(state, tb); case 6: return proto_shell_add_host_dependency(state, tb); + case 7: + return proto_shell_setup_failed(state); default: return UBUS_STATUS_INVALID_ARGUMENT; } |