From a5dd60c8d7e04731f12108838a3c82149e04ef9c Mon Sep 17 00:00:00 2001 From: Daniel-Constantin Mierla Date: Tue, 3 Apr 2018 09:27:19 +0200 Subject: [PATCH] ipops: mask subnet address for ipv6 comparison - coherent with ipv4 behaviour --- src/modules/ipops/ipops_mod.c | 1 + 1 file changed, 1 insertion(+) diff --git a/src/modules/ipops/ipops_mod.c b/src/modules/ipops/ipops_mod.c index e2a25f38f98..262f4a84946 100644 --- a/src/modules/ipops/ipops_mod.c +++ b/src/modules/ipops/ipops_mod.c @@ -415,6 +415,7 @@ int _ip_is_in_subnet_v6(struct in6_addr *ip, char *net, size_t netlen, else ipv6_mask[i] = 0x00; } for (i=0; i<16; i++) ip->s6_addr[i] &= ipv6_mask[i]; + for (i=0; i<16; i++) net_addr.s6_addr[i] &= ipv6_mask[i]; if (memcmp(ip->s6_addr, net_addr.s6_addr, sizeof(net_addr.s6_addr)) == 0) return 1; return 0;