summary |
shortlog |
log |
commit | commitdiff |
tree
raw |
patch |
inline | side by side (from parent 1:
e46cbd2)
If a renew event arrives before the setup event has been processed, the
renew event needs to be deferred, otherwise interfaces can get stuck
Signed-off-by: Felix Fietkau <nbd@openwrt.org>
enum proto_shell_sm sm;
bool proto_task_killed;
enum proto_shell_sm sm;
bool proto_task_killed;
} else if (cmd == PROTO_CMD_RENEW) {
if (!(handler->proto.flags & PROTO_FLAG_RENEW_AVAILABLE))
return 0;
} else if (cmd == PROTO_CMD_RENEW) {
if (!(handler->proto.flags & PROTO_FLAG_RENEW_AVAILABLE))
return 0;
+
+ if (state->script_task.uloop.pending) {
+ state->renew_pending = true;
+ return 0;
+ }
+
action = "renew";
} else {
if (state->sm == S_TEARDOWN)
return 0;
action = "renew";
} else {
if (state->sm == S_TEARDOWN)
return 0;
+ state->renew_pending = false;
if (state->script_task.uloop.pending) {
if (state->sm != S_SETUP_ABORT) {
uloop_timeout_set(&state->teardown_timeout, 1000);
if (state->script_task.uloop.pending) {
if (state->sm != S_SETUP_ABORT) {
uloop_timeout_set(&state->teardown_timeout, 1000);
if (task == &state->proto_task)
proto_shell_handler(&state->proto, PROTO_CMD_TEARDOWN,
false);
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);
break;
case S_SETUP_ABORT:
break;
case S_SETUP_ABORT: