wlan-ap-Telecominfraproject/feeds/wlan-ap/opensync/patches/21-sm-ubus-collector.patch
Ammad Rehmat 33712c0843 Wifi-1064 : Client events patches fix
Signed-off-by: Ammad Rehmat <ammad.rehmat@connectus.ai>
2020-11-16 08:40:06 +01:00

60 lines
1.6 KiB
Diff

Index: opensync-2.0.5.0/src/sm/src/sm_main.c
===================================================================
--- opensync-2.0.5.0.orig/src/sm/src/sm_main.c
+++ opensync-2.0.5.0/src/sm/src/sm_main.c
@@ -46,6 +46,7 @@ SOFTWARE, EVEN IF ADVISED OF THE POSSIBI
#include "dppline.h"
#include "os_backtrace.h"
#include "json_util.h"
+#include "ubus_collector.h"
#include "sm.h"
@@ -130,11 +131,15 @@ int main (int argc, char **argv)
return -1;
}
- if (sm_setup_monitor()) {
+ if (ubus_collector_init()) {
+ LOGE("Initializing ubus collector "
+ "(Failed to initialize ubus collector)");
return -1;
}
- backtrace_init();
+ if (sm_setup_monitor()) {
+ return -1;
+ }
ev_run(EV_DEFAULT, 0);
@@ -149,6 +154,8 @@ int main (int argc, char **argv)
ev_default_destroy();
+ ubus_collector_cleanup();
+
LOGN("Exiting SM");
return 0;
Index: opensync-2.0.5.0/src/sm/unit.mk
===================================================================
--- opensync-2.0.5.0.orig/src/sm/unit.mk
+++ opensync-2.0.5.0/src/sm/unit.mk
@@ -47,6 +47,7 @@ UNIT_SRC += src/sm_network_probe_rep
UNIT_SRC += src/sm_events_report.c
UNIT_SRC += src/ucc_report.c
UNIT_SRC += src/sm_common.c
+UNIT_SRC += src/ubus_collector.c
ifeq ($(CONFIG_SM_CAPACITY_QUEUE_STATS),y)
UNIT_SRC += src/sm_capacity_report.c
@@ -60,6 +61,7 @@ UNIT_LDFLAGS += -lrt
UNIT_LDFLAGS += -lz
UNIT_LDFLAGS += -lnl-tiny -lubox
UNIT_LDFLAGS += -lcurl -lradiusclient
+UNIT_LDFLAGS += -lubus
UNIT_DEPS := src/lib/ovsdb
UNIT_DEPS += src/lib/pjs