From: Michael Tremer Date: Thu, 12 Nov 2020 19:21:58 +0000 (+0000) Subject: network: Reduce debugging output X-Git-Tag: 0.9.5~81 X-Git-Url: http://git.ipfire.org/?p=people%2Fms%2Flibloc.git;a=commitdiff_plain;h=f5e50a47e37e9b29d0d2ee9e5a41e5a5fe5aea7f network: Reduce debugging output Signed-off-by: Michael Tremer --- diff --git a/src/network.c b/src/network.c index 44571b3..f7071a6 100644 --- a/src/network.c +++ b/src/network.c @@ -421,37 +421,17 @@ LOC_EXPORT int loc_network_match_flag(struct loc_network* network, uint32_t flag } LOC_EXPORT int loc_network_eq(struct loc_network* self, struct loc_network* other) { -#ifdef ENABLE_DEBUG - char* n1 = loc_network_str(self); - char* n2 = loc_network_str(other); - - DEBUG(self->ctx, "Is %s equal to %s?\n", n1, n2); - - free(n1); - free(n2); -#endif - // Family must be the same - if (self->family != other->family) { - DEBUG(self->ctx, " Family mismatch\n"); - + if (self->family != other->family) return 0; - } // The start address must be the same - if (in6_addr_cmp(&self->first_address, &other->first_address) != 0) { - DEBUG(self->ctx, " Address mismatch\n"); - + if (in6_addr_cmp(&self->first_address, &other->first_address) != 0) return 0; - } // The prefix length must be the same - if (self->prefix != other->prefix) { - DEBUG(self->ctx, " Prefix mismatch\n"); + if (self->prefix != other->prefix) return 0; - } - - DEBUG(self->ctx, " Yes!\n"); return 1; } @@ -1138,8 +1118,6 @@ static void loc_network_list_swap(struct loc_network_list* list, unsigned int i1 if (i1 >= list->size || i2 >= list->size) return; - DEBUG(list->ctx, "Swapping %u with %u\n", i1, i2); - struct loc_network* network1 = list->list[i1]; struct loc_network* network2 = list->list[i2];