From f0619047c2db9026f0b6d772e86af618f6ee258f Mon Sep 17 00:00:00 2001 From: Marcel Holtmann Date: Mon, 3 Dec 2018 19:54:33 +0100 Subject: [PATCH] mesh: Fix various compiler warnings --- mesh/btmesh.c | 1 + mesh/main.c | 1 + mesh/net.c | 15 +++++++++------ 3 files changed, 11 insertions(+), 6 deletions(-) diff --git a/mesh/btmesh.c b/mesh/btmesh.c index 6a005a978..083947bae 100644 --- a/mesh/btmesh.c +++ b/mesh/btmesh.c @@ -24,6 +24,7 @@ #include #include +#include #include #include diff --git a/mesh/main.c b/mesh/main.c index 97f506a75..db6bee588 100644 --- a/mesh/main.c +++ b/mesh/main.c @@ -24,6 +24,7 @@ #include #include +#include #include #include #include diff --git a/mesh/net.c b/mesh/net.c index 444d383e4..c9f057fe1 100644 --- a/mesh/net.c +++ b/mesh/net.c @@ -2041,8 +2041,9 @@ static bool seg_rxed(struct mesh_net *net, bool frnd, l_timeout_remove(sar_in->seg_timeout); sar_in->seg_timeout = NULL; return true; + } - } else if (reset_seg_to) { + if (reset_seg_to) { /* Restart Inter-Seg Timeout */ l_timeout_remove(sar_in->seg_timeout); @@ -2054,8 +2055,10 @@ static bool seg_rxed(struct mesh_net *net, bool frnd, sar_in->seg_timeout = l_timeout_create(SEG_TO, inseg_to, net, NULL); - } - } + } else + largest = 0; + } else + largest = 0; l_debug("NAK: %d expected:%08x largest:%08x flags:%08x", reset_seg_to, expected, largest, sar_in->flags); @@ -2819,9 +2822,6 @@ static void lpn_process_beacon(void *user_data, const void *data, rxed_key_refresh = (buf[0] & 0x01) == 0x01; iv_index = l_get_be32(buf + 1); - l_debug("KR: %d -- IVU: %d -- IV: %8.8x", - rxed_key_refresh, iv_index); - /* Inhibit recognizing iv_update true-->false if we have outbound * SAR messages in flight */ @@ -2830,6 +2830,9 @@ static void lpn_process_beacon(void *user_data, const void *data, iv_update = true; } + l_debug("KR: %d -- IVU: %d -- IV: %8.8x", + rxed_key_refresh, iv_update, iv_index); + /* TODO: figure out actual network index (i.e., friendship subnet) */ subnet = get_primary_subnet(net); if (!subnet) -- 2.47.3