if (task == &state->proto_task)
proto_shell_handler(&state->proto, PROTO_CMD_TEARDOWN,
false);
- if (task == &state->script_task && state->renew_pending)
- proto_shell_handler(&state->proto, PROTO_CMD_RENEW,
- false);
+ if (task == &state->script_task) {
+ if (state->renew_pending)
+ proto_shell_handler(&state->proto,
+ PROTO_CMD_RENEW, false);
+ else if (!state->proto_task.uloop.pending &&
+ state->sm == S_SETUP)
+ proto_shell_handler(&state->proto,
+ PROTO_CMD_TEARDOWN,
+ false);
+ }
break;
case S_SETUP_ABORT:
if (tmp && json_object_get_boolean(tmp))
handler->proto.flags |= PROTO_FLAG_RENEW_AVAILABLE;
+ tmp = json_get_field(obj, "lasterror", json_type_boolean);
+ if (tmp && json_object_get_boolean(tmp))
+ handler->proto.flags |= PROTO_FLAG_LASTERROR;
+
config = json_get_field(obj, "config", json_type_array);
if (config)
handler->config_buf = netifd_handler_parse_config(&handler->config, config);