summaryrefslogtreecommitdiff
path: root/proto-shell.c
diff options
context:
space:
mode:
authorHans Dedecker <dedeckeh@gmail.com>2016-08-11 15:53:26 +0200
committerFelix Fietkau <nbd@nbd.name>2016-08-11 19:34:34 +0200
commit4789adf1e55cf51a8b556fba0c7c31bb5f430c7d (patch)
treee92d3b771d41b29b412f50b766d61d7bdc72a84d /proto-shell.c
parente7dbda3d64e98276570cba3b0c0f94461f77d645 (diff)
downloadnetifd-4789adf1e55cf51a8b556fba0c7c31bb5f430c7d.tar.gz
proto-shell: Model config parameter "no-proto-task" as a proto flag
Export the config parameter "no-proto-task" as a proto flag so it's available for other other netifd modules Signed-off-by: Hans Dedecker <dedeckeh@gmail.com>
Diffstat (limited to 'proto-shell.c')
-rw-r--r--proto-shell.c6
1 files changed, 3 insertions, 3 deletions
diff --git a/proto-shell.c b/proto-shell.c
index 4391cdd..998a44c 100644
--- a/proto-shell.c
+++ b/proto-shell.c
@@ -44,7 +44,6 @@ struct proto_shell_handler {
char *config_buf;
char *script_name;
bool init_available;
- bool no_proto_task;
struct uci_blob_param_list config;
};
@@ -306,7 +305,7 @@ proto_shell_task_finish(struct proto_shell_state *state,
if (state->renew_pending)
proto_shell_handler(&state->proto,
PROTO_CMD_RENEW, false);
- else if (!state->handler->no_proto_task &&
+ else if (!(state->handler->proto.flags & PROTO_FLAG_NO_TASK) &&
!state->proto_task.uloop.pending &&
state->sm == S_SETUP)
proto_shell_handler(&state->proto,
@@ -892,7 +891,8 @@ proto_shell_add_handler(const char *script, const char *name, json_object *obj)
handler->proto.flags |= PROTO_FLAG_NODEV;
tmp = json_get_field(obj, "no-proto-task", json_type_boolean);
- handler->no_proto_task = tmp && json_object_get_boolean(tmp);
+ if (tmp && json_object_get_boolean(tmp))
+ handler->proto.flags |= PROTO_FLAG_NO_TASK;
tmp = json_get_field(obj, "available", json_type_boolean);
if (tmp && json_object_get_boolean(tmp))