Skip to content

Commit

Permalink
gluon-mesh-babel: remove explicit ubus socket specification, convert …
Browse files Browse the repository at this point in the history
…timeout to expected units
  • Loading branch information
neocturne committed Nov 24, 2019
1 parent b4101e5 commit f34b302
Showing 1 changed file with 3 additions and 4 deletions.
7 changes: 3 additions & 4 deletions package/gluon-mesh-babel/src/respondd.c
Original file line number Diff line number Diff line change
Expand Up @@ -74,8 +74,7 @@
#define IFNAMELEN 32
#define PROTOLEN 32

#define UBUS_TIMEOUT 30
#define UBUS_SOCKET "/var/run/ubus.sock"
#define UBUS_TIMEOUT 30000

static struct babelhelper_ctx bhelper_ctx = {};

Expand Down Expand Up @@ -330,15 +329,15 @@ static struct json_object * get_mesh_ifs() {

unsigned int id=8;

ubus_ctx = ubus_connect(UBUS_SOCKET);
ubus_ctx = ubus_connect(NULL);
if (!ubus_ctx) {
fprintf(stderr,"could not connect to ubus, not providing mesh-data\n");
goto end;
}

blob_buf_init(&b, 0);
ubus_lookup_id(ubus_ctx, "network.interface", &id);
int uret = ubus_invoke(ubus_ctx, id, "dump", b.head, receive_call_result_data, &ret, UBUS_TIMEOUT * 1000);
int uret = ubus_invoke(ubus_ctx, id, "dump", b.head, receive_call_result_data, &ret, UBUS_TIMEOUT);

if (uret > 0)
fprintf(stderr, "ubus command failed: %s\n", ubus_strerror(uret));
Expand Down

0 comments on commit f34b302

Please sign in to comment.