- Jul 01, 2019
-
-
Alban Bedel authored
Extend the cmake config to build and install static libraries when -DBUILD_STATIC=ON is used. Signed-off-by:
Alban Bedel <albeu@free.fr>
-
- Apr 23, 2019
-
-
Felix Fietkau authored
Avoids unnecessary delays and/or blocking on messages Signed-off-by:
Felix Fietkau <nbd@nbd.name>
-
- Apr 16, 2019
-
-
Felix Fietkau authored
Data is often already present here Signed-off-by:
Felix Fietkau <nbd@nbd.name>
-
Felix Fietkau authored
If the header is read but not the remainder of the message, the stream will be out of sync and parsing of future messages won't work Signed-off-by:
Felix Fietkau <nbd@nbd.name>
-
- Oct 06, 2018
-
-
Hans Dedecker authored
Adds event send access list support in ubus via the "send" keyword Example of a json file: { "user": "superuser", "send": [ "wireless.*" ], } Signed-off-by:
Koen Dergent <koen.cj.dergent@gmail.com> Signed-off-by:
Hans Dedecker <dedeckeh@gmail.com>
-
Hans Dedecker authored
Adds event listen access list support in ubus via the "listen" keyword Example of a json file: { "user": "superuser", "listen": [ "network.*" ], } Signed-off-by:
Koen Dergent <koen.cj.dergent@gmail.com> Signed-off-by:
Hans Dedecker <dedeckeh@gmail.com>
-
Hans Dedecker authored
Wildcard access list support was failing in case multiple wildcards entries were defined and/or when a specific access list string overlapped a wildcard entry. Root cause of the problem was the way how wildcard entries were sorted in the avl tree by the compare function ubusd_acl_match_path resulting into a non acces list match for a given object path. The avl_tree sorting has been changed to make use of avl_strcmp; as such there's no distinction anymore between non-wildcard and wildcard entries in the avl_tree compare function as the boolean partial marks an access list entry as a wildcard entry. When trying to find an access list match for an object path the access list tree is iterated as long as the number of characters between the access list string and object path is monotonically increasing. Signed-off-by:
Hans Dedecker <dedeckeh@gmail.com>
-
Hans Dedecker authored
Rename strmatch_len into ubus_strmatch_len and move it to ubus_common.h Signed-off-by:
Hans Dedecker <dedeckeh@gmail.com>
-
- Sep 10, 2018
-
-
Marcus Comstedt authored
Signed-off-by:
Marcus Comstedt <marcus@mc.pp.se>
-
- Jul 26, 2018
-
-
Felix Fietkau authored
Signed-off-by:
Felix Fietkau <nbd@nbd.name>
-
- Jul 25, 2018
-
-
Felix Fietkau authored
UBUS_MSG_INVOKE and UBUS_MSG_DATA can be sent without UBUS_ATTR_DATA present. Most ubus users assume that the msg argument passed can never be NULL, so this change prevents a crash Signed-off-by:
Felix Fietkau <nbd@nbd.name>
-
- Jan 17, 2018
-
-
Dirk Feytons authored
The callback function registered to be invoked when subscribing to a notification was only passed the notification data (if any) but not the name of the notification. This name is now passed as second argument to remain backwards compatible. The example subscriber.lua has also be updated. Signed-off-by:
Dirk Feytons <dirk.feytons@gmail.com>
-
John Crispin authored
==18834== Warning: invalid file descriptor -1 in syscall close() ==18834== at 0x5326D20: __close_nocancel (syscall-template.S:84) ==18834== by 0x5046DC7: ubus_process_obj_msg (libubus-obj.c:143) ==18834== by 0x5045E98: ubus_process_msg (libubus.c:106) ==18834== by 0x50468D0: ubus_handle_data (libubus-io.c:314) ==18834== by 0x4E3D125: uloop_run_events (uloop.c:198) ==18834== by 0x4E3D125: uloop_run_timeout (uloop.c:555) ==18834== by 0x109BEF: uloop_run (uloop.h:111) ==18834== by 0x109BEF: main (main.c:25) Signed-off-by:
John Crispin <john@phrozen.org>
-
John Crispin authored
valgrind complained about this one ==18632== Warning: invalid file descriptor -1 in syscall close() ==18632== at 0x5326D20: __close_nocancel (syscall-template.S:84) ==18632== by 0x5046C02: ubus_process_invoke (libubus-obj.c:98) ==18632== by 0x5046DC3: ubus_process_obj_msg (libubus-obj.c:142) ==18632== by 0x5045E98: ubus_process_msg (libubus.c:106) ==18632== by 0x50468D0: ubus_handle_data (libubus-io.c:314) ==18632== by 0x4E3D125: uloop_run_events (uloop.c:198) ==18632== by 0x4E3D125: uloop_run_timeout (uloop.c:555) ==18632== by 0x109BEF: uloop_run (uloop.h:111) ==18632== by 0x109BEF: main (main.c:25) Signed-off-by:
John Crispin <john@phrozen.org>
-
- Nov 13, 2017
-
-
Alexandru Ardelean authored
Even with the tx_queue-ing issue resolved, what seems to happen afterwards, is that all the messages seems to get through, but the client still loops in the `ubus_complete_request()` waiting for `req->status_msg` or for a timeout. Though, the timeout does not seem to happen, because the data is processed in `ubus_poll_data()`, with a infinite poll() timeout (ubus_complete_request() is called with timeout 0). It's likely that either the `seq` or `peer` sent from ubusd are wrong, and the client cannot get the correct ubus request in `ubus_process_req_msg()`. I haven't digged too deep into this ; setting the `retmsg` object on the client struct seems to have resolved any hanging with the `ubus list` command. Signed-off-by:
Alexandru Ardelean <ardeleanalex@gmail.com> Signed-off-by: Felix Fietkau <nbd@nbd.name> [fix placement of retmsg in cl]
-
Alexandru Ardelean authored
Should save a few cycles, since the data that's being changed is only the seq number. And the `ub` is always created as shared. Signed-off-by:
Alexandru Ardelean <ardeleanalex@gmail.com>
-
Alexandru Ardelean authored
Semantic has changed a bit. Signed-off-by:
Alexandru Ardelean <ardeleanalex@gmail.com>
-
Alexandru Ardelean authored
This makes it clear that `ubus_msg_send()` is only about sending and queue-ing messages, and has nothing to do with free-ing. It can be a bit misleading/confusing when trying to go through the code and make assumptions about whether a buffer is free'd in ubus_send_msg(), or is free'd outside. In `ubusd_proto_receive_message()` the `ubus_msg_free()` is now called before the `if (ret == -1)` check. That way, all callbacks will have their messages free'd, which is what's desired, but confusing, because: * ubusd_handle_invoke() called ubus_msg_free() before returning -1 * ubusd_handle_notify() called ubus_msg_free() before returning -1 * ubusd_handle_response() called ubus_msg_send(,,free=true) before returning -1 * ubus_msg_send() would call ubus_msg_send(,,free=false) * all other callback callers would `ubus_msg_send(,,free=true)` (free the buffers in ubus_msg_send() ) In all other places, where `ubus_msg_send(,,free=true)` an explicit `ubus_msg_free()` was added. Signed-off-by:
Alexandru Ardelean <ardeleanalex@gmail.com>
-
Bob Ham authored
Objects are stored in the ubus context in an AVL tree. An AVL tree node contains a pointer to a key value. For the ubus context, this points to the id member of the object structure. In ubus_remove_object_cb, the id member is set to zero and then after, avl_delete is called and fails. To fix this, we call avl_delete before setting the object id to zero. Signed-off-by:
Bob Ham <bob.ham@tomltd.co.uk>
-
Rosen Penev authored
Replace malloc+memset with calloc. Signed-off-by:
Rosen Penev <rosenp@gmail.com> Signed-off-by:
Felix Fietkau <nbd@nbd.name>
-
- Nov 06, 2017
-
-
John Crispin authored
Signed-off-by:
John Crispin <john@phrozen.org>
-
- Feb 20, 2017
-
-
Hans Dedecker authored
Variable listen_timeout is redefined as a function resulting into a compile issue. Define the function as ubus_cli_listen_timeout to fix the compile issue. Signed-off-by:
Hans Dedecker <dedeckeh@gmail.com>
-
Hans Dedecker authored
When ubus connect fails ctx->sock.eof will be set but ctx->sock.error can be set as well. Reset ctx->sock.error as well when doing ubus reconnect Signed-off-by:
Hans Dedecker <dedeckeh@gmail.com>
-
- Feb 15, 2017
-
-
Felix Fietkau authored
Default to listening for events forever unless -t is explicitly specified on the command line Signed-off-by:
Felix Fietkau <nbd@nbd.name>
-
- Feb 14, 2017
-
-
Felix Fietkau authored
Signed-off-by:
Felix Fietkau <nbd@nbd.name>
-
- Feb 07, 2017
-
-
Alexandru Ardelean authored
For a shared ubus_msg_buf, the ubus_msg_ref function will create a copy for queue-ing. Problem is, that during the dequeue (especially) in client_cb, the header is 0-ed (because it's was a newly alloc-ed buffer). And during ubus_msg_writev(), the header info will be ignored by the client. Signed-off-by:
Alexandru Ardelean <ardeleanalex@gmail.com>
-
- Feb 03, 2017
-
-
Felix Fietkau authored
uloop_cancelled was used for two purposes within ubus_complete_request: - interrupting recursive requests on SIGINT/SIGTERM - breaking out of the poll loop in a recursive request that completed Saving/restorung uloop_cancelled was buggy, leading to SIGTERM not being processed properly. Simplify the logic by using a separate field for internal use Signed-off-by:
Felix Fietkau <nbd@nbd.name>
-
Felix Fietkau authored
Signed-off-by:
Felix Fietkau <nbd@nbd.name>
-
- Jan 22, 2017
-
-
Felix Fietkau authored
This was leftover code from before this codepath was converted to polling directly Signed-off-by:
Felix Fietkau <nbd@nbd.name>
-
Felix Fietkau authored
uloop should not be used before it is initialized Signed-off-by:
Felix Fietkau <nbd@nbd.name>
-
- Jan 20, 2017
-
-
Mihai Richard authored
An -1 returned by ubus_msg_writev() will be interpreted as UINT_MAX during a check to see how much data had could be written on the socket. Because sizeof() will return size_t it will promote the comparsion to unsigned Signed-off-by:
Mihai Richard <mihairichard@live.com>
-
- Jan 04, 2017
-
-
Abhimanyu Vishwakarma authored
If a synchronous operation is executed on a ubus context after uloop_done() has been called, the context's pending_timer may remain in uloop's list of timeouts. This leads to undefined behaviour during next execution of uloop code, as it may be referring to unavailable memory or memory that has been allocated for different purposes. Signed-off-by:
Marcin Nowakowski <marcin.nowakowski@imgtec.com> Signed-off-by:
Abhimanyu Vishwakarma <Abhimanyu.Vishwakarma@imgtec.com>
-
- Dec 24, 2016
-
-
Felix Fietkau authored
Signed-off-by:
Felix Fietkau <nbd@nbd.name>
-
amine ahd authored
Signed-off-by:
amine.ahd <amine.ahd@gmail.com>
-
Felix Fietkau authored
Signed-off-by:
Felix Fietkau <nbd@nbd.name>
-
- Nov 21, 2016
-
-
Vasily Goldobin authored
Add Lua bindings for 'ubus_defer_request' and 'ubus_complete_deferred_request' functions with sample code. Signed-off-by:
Vasily Goldobin <vasily@lynxtech.ru>
-
- Nov 20, 2016
-
-
Felix Fietkau authored
Signed-off-by:
Felix Fietkau <nbd@nbd.name>
-
Felix Fietkau authored
Signed-off-by:
Felix Fietkau <nbd@nbd.name>
-
- Oct 12, 2016
-
-
Alexandru Ardelean authored
We seem to be getting timeout for ubus wait_for calls every now and then. And it's not reliably reproducible. Looking at the code the only thing that would look like a potetntial reason, is that between the ubus_lookup() and ubus_register_event_handler() calls, there's a very narrow window where the event would get sent out and we would not get it, thus having to timeout. It doesn't look like registering the event handler first is a big problem for the whole wait_check_object() logic. Signed-off-by:
Alexandru Ardelean <ardeleanalex@gmail.com>
-
- Sep 05, 2016
-
-
Denis Osvald authored
Signed-off-by:
Denis Osvald <denis.osvald@sartura.hr>
-