From 0d33b6719261b5b4dc14aa188d086a9aaafe45f2 Mon Sep 17 00:00:00 2001 From: Michael Tremer Date: Tue, 30 Jan 2018 23:29:28 +0000 Subject: [PATCH] network: Fix checking upper bound when matching IP addresses Signed-off-by: Michael Tremer --- src/network.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/network.c b/src/network.c index 45afd40..cf39647 100644 --- a/src/network.c +++ b/src/network.c @@ -276,7 +276,7 @@ LOC_EXPORT int loc_network_match_address(struct loc_network* network, const stru struct in6_addr last_address = make_last_address(&network->start_address, network->prefix); // Address must be smaller than the last address - if (in6_addr_cmp(&last_address, address) > 0) + if (in6_addr_cmp(address, &last_address) > 0) return 1; // The address is inside this network -- 2.39.2