b.liu | e958203 | 2025-04-17 19:18:16 +0800 | [diff] [blame^] | 1 | --- a/src/scheduler.c |
| 2 | +++ b/src/scheduler.c |
| 3 | @@ -59,6 +59,8 @@ |
| 4 | #include <assert.h> |
| 5 | #include <time.h> |
| 6 | |
| 7 | +#include "ubus.h" |
| 8 | + |
| 9 | #ifdef __MACH__ |
| 10 | #include "mach/clock_gettime.h" |
| 11 | #endif |
| 12 | @@ -363,6 +365,8 @@ poll_sockets(void) |
| 13 | } |
| 14 | OLSR_FOR_ALL_SOCKETS_END(entry); |
| 15 | |
| 16 | + hfd = olsrd_ubus_add_read_sock(&ibits, hfd); |
| 17 | + |
| 18 | /* Running select on the FD set */ |
| 19 | do { |
| 20 | n = olsr_select(hfd, fdsets & SP_PR_READ ? &ibits : NULL, fdsets & SP_PR_WRITE ? &obits : NULL, NULL, &tvp); |
| 21 | @@ -395,6 +399,7 @@ poll_sockets(void) |
| 22 | } |
| 23 | } |
| 24 | OLSR_FOR_ALL_SOCKETS_END(entry); |
| 25 | + olsrd_ubus_receive(&ibits); |
| 26 | } |
| 27 | |
| 28 | static void |
| 29 | --- a/src/main.c |
| 30 | +++ b/src/main.c |
| 31 | @@ -74,6 +74,8 @@ |
| 32 | #include "lock_file.h" |
| 33 | #include "cli.h" |
| 34 | |
| 35 | +#include "ubus.h" |
| 36 | + |
| 37 | #if defined(__GLIBC__) && defined(__linux__) && !defined(__ANDROID__) && !defined(__UCLIBC__) |
| 38 | #define OLSR_HAVE_EXECINFO_H |
| 39 | #endif |
| 40 | @@ -771,6 +773,9 @@ int main(int argc, char *argv[]) { |
| 41 | signal(SIGUSR2, SIG_IGN); |
| 42 | #endif /* _WIN32 */ |
| 43 | |
| 44 | + /* Adding ubus */ |
| 45 | + olsrd_add_ubus(); |
| 46 | + |
| 47 | /* Starting scheduler */ |
| 48 | olsr_scheduler(); |
| 49 | |
| 50 | --- a/Makefile.inc |
| 51 | +++ b/Makefile.inc |
| 52 | @@ -252,7 +252,7 @@ else |
| 53 | ifeq ($(OS),win32) |
| 54 | LDFLAGS += -Wl,-export-all-symbols |
| 55 | else |
| 56 | - LDFLAGS += -Wl,-export-dynamic |
| 57 | + LDFLAGS += -Wl,-export-dynamic,-lubus,-lubox |
| 58 | endif |
| 59 | ifeq ($(NORPATH),0) |
| 60 | LDFLAGS += -Wl,-rpath,$(LIBDIR) |