Skip to content

Commit

Permalink
ubus: fix uc_ubus_have_uloop for eloop+uloop combination
Browse files Browse the repository at this point in the history
When uloop has been integrated with eloop (in hostapd/wpa_supplicant),
uloop_cancelling will return false, since uloop_run is not being called.
This leads to ubus.defer() calling uloop_run in a context where it can
prevent the other event loop from running.

Fix this by detecting event loop integration via uloop_fd_set_cb being set

Signed-off-by: Felix Fietkau <[email protected]>
  • Loading branch information
nbd168 committed May 1, 2024
1 parent 69dd962 commit edeae41
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions lib/ubus.c
Original file line number Diff line number Diff line change
Expand Up @@ -665,6 +665,9 @@ uc_ubus_have_uloop(void)
bool prev = uloop_cancelled;
bool active;

if (uloop_fd_set_cb)
return true;

uloop_cancelled = true;
active = uloop_cancelling();
uloop_cancelled = prev;
Expand Down

0 comments on commit edeae41

Please sign in to comment.