From 2e8584ae8a6d2e089f7a6db7628b218792a35c99 Mon Sep 17 00:00:00 2001 From: Sukru Senli <sukru.senli@inteno.se> Date: Wed, 1 Nov 2017 13:49:39 +0100 Subject: [PATCH] loop-detector: do not segfault if uci config is not there --- loop-detector.c | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/loop-detector.c b/loop-detector.c index 9618ffc..12084f4 100644 --- a/loop-detector.c +++ b/loop-detector.c @@ -17,7 +17,7 @@ char **portsNames=NULL; uint8_t portsnumber=0; -uint8_t send_loop_discovery_period = 7; +uint8_t send_loop_discovery_period = 10; uint8_t send_discovery_numbertimes = 5; /* @@ -43,8 +43,10 @@ void getAppUciParams(void){ if (uci_load(uci_ctx, "loopDetect", &uci_config_package)) { uci_free_context(uci_ctx); uci_ctx = NULL; + return; } - send_loop_discovery_period = 7; + + send_loop_discovery_period = 10; send_discovery_numbertimes = 5; uci_foreach_element(&uci_config_package->sections, e2) { s = uci_to_section(e2); -- GitLab