X-Git-Url: https://git.archive.openwrt.org/?p=project%2Fnetifd.git;a=blobdiff_plain;f=proto-shell.c;h=86126317271e235df613870f7e4f44ad1437a45d;hp=281debc056146d13085376e9b095a084e5589ec0;hb=7f081660bf24fed49a716022a6ea17bb1dcde73a;hpb=e32103ad7e944ccbebef4335333481e565311f5c diff --git a/proto-shell.c b/proto-shell.c index 281debc..8612631 100644 --- a/proto-shell.c +++ b/proto-shell.c @@ -111,7 +111,7 @@ proto_shell_attach(const struct proto_handler *h, struct interface *iface, memcpy(state->config, attr, blob_pad_len(attr)); state->proto.free = proto_shell_free; - state->proto.handler = proto_shell_handler; + state->proto.cb = proto_shell_handler; state->handler = container_of(h, struct proto_shell_handler, proto); return &state->proto; @@ -230,6 +230,10 @@ proto_shell_add_handler(const char *script, json_object *obj) proto->config_params = &handler->config; proto->attach = proto_shell_attach; + tmp = get_field(obj, "no-device", json_type_boolean); + if (tmp && json_object_get_boolean(tmp)) + handler->proto.flags |= PROTO_FLAG_NODEV; + config = get_field(obj, "config", json_type_array); if (config) handler->config_buf = proto_shell_parse_config(&handler->config, config);