100-ubus-fix-uc_ubus_have_uloop-for-eloop-uloop-combinat.patch 782 B

1234567891011121314151617181920212223242526
  1. From: Felix Fietkau <[email protected]>
  2. Date: Wed, 1 May 2024 18:40:19 +0200
  3. Subject: [PATCH] ubus: fix uc_ubus_have_uloop for eloop+uloop combination
  4. When uloop has been integrated with eloop (in hostapd/wpa_supplicant),
  5. uloop_cancelling will return false, since uloop_run is not being called.
  6. This leads to ubus.defer() calling uloop_run in a context where it can
  7. prevent the other event loop from running.
  8. Fix this by detecting event loop integration via uloop_fd_set_cb being set
  9. Signed-off-by: Felix Fietkau <[email protected]>
  10. ---
  11. --- a/lib/ubus.c
  12. +++ b/lib/ubus.c
  13. @@ -665,6 +665,9 @@ uc_ubus_have_uloop(void)
  14. bool prev = uloop_cancelled;
  15. bool active;
  16. + if (uloop_fd_set_cb)
  17. + return true;
  18. +
  19. uloop_cancelled = true;
  20. active = uloop_cancelling();
  21. uloop_cancelled = prev;