From e384f899b70e3b84d8ba94bd63f26c67c72d8788 Mon Sep 17 00:00:00 2001 From: Matthias Schiffer Date: Thu, 2 Jul 2020 00:10:29 +0200 Subject: [PATCH 1/3] gluon-radv-filterd: remove unneeded memset --- package/gluon-radv-filterd/src/gluon-radv-filterd.c | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/package/gluon-radv-filterd/src/gluon-radv-filterd.c b/package/gluon-radv-filterd/src/gluon-radv-filterd.c index ed090c46..e411d8bf 100644 --- a/package/gluon-radv-filterd/src/gluon-radv-filterd.c +++ b/package/gluon-radv-filterd/src/gluon-radv-filterd.c @@ -559,14 +559,13 @@ static int parse_tt_local(struct nl_msg *msg, } static void update_tqs(void) { + static const struct ether_addr unspec = {}; struct router *router; bool update_originators = false; - struct ether_addr unspec; struct batadv_nlquery_opts opts; int ret; // reset TQs - memset(&unspec, 0, sizeof(unspec)); foreach(router, G.routers) { router->tq = 0; if (ether_addr_equal(router->originator, unspec)) From fcd07de6767e9cba392cd2a30b4579b6a7cc0d21 Mon Sep 17 00:00:00 2001 From: Matthias Schiffer Date: Thu, 2 Jul 2020 00:10:45 +0200 Subject: [PATCH 2/3] gluon-radv-filterd: downgrade frequent messages to DEBUG_MSG When the network connectivity is bad, routers may not appear in the translation tables, or there may be no originator with TQ >0. Such conditions to not warrant spamming the log with error messages. --- package/gluon-radv-filterd/src/gluon-radv-filterd.c | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/package/gluon-radv-filterd/src/gluon-radv-filterd.c b/package/gluon-radv-filterd/src/gluon-radv-filterd.c index e411d8bf..b1620cae 100644 --- a/package/gluon-radv-filterd/src/gluon-radv-filterd.c +++ b/package/gluon-radv-filterd/src/gluon-radv-filterd.c @@ -608,12 +608,12 @@ static void update_tqs(void) { foreach(router, G.routers) { if (router->tq == 0) { if (ether_addr_equal(router->originator, unspec)) - fprintf(stderr, - "Unable to find router " F_MAC " in transtable_{global,local}\n", + DEBUG_MSG( + "Unable to find router " F_MAC " in transtable_{global,local}", F_MAC_VAR(router->src)); else - fprintf(stderr, - "Unable to find TQ for originator " F_MAC " (router " F_MAC ")\n", + DEBUG_MSG( + "Unable to find TQ for originator " F_MAC " (router " F_MAC ")", F_MAC_VAR(router->originator), F_MAC_VAR(router->src)); } From e32fa5bc6454813f8bb9e82d91accd7b426e33c5 Mon Sep 17 00:00:00 2001 From: Matthias Schiffer Date: Thu, 2 Jul 2020 00:16:36 +0200 Subject: [PATCH 3/3] gluon-radv-filterd: add string.h and guard to mac.h - #pragma once include guard - include string.h to get memset and memcmp prototypes to fix respondd provider build warning --- package/gluon-radv-filterd/src/mac.h | 3 +++ 1 file changed, 3 insertions(+) diff --git a/package/gluon-radv-filterd/src/mac.h b/package/gluon-radv-filterd/src/mac.h index cc24d907..eece1105 100644 --- a/package/gluon-radv-filterd/src/mac.h +++ b/package/gluon-radv-filterd/src/mac.h @@ -1,4 +1,7 @@ +#pragma once + #include +#include #include #define F_MAC "%02hhx:%02hhx:%02hhx:%02hhx:%02hhx:%02hhx"