Skip to content

Commit

Permalink
ipops: mask subnet address for ipv6 comparison
Browse files Browse the repository at this point in the history
- coherent with ipv4 behaviour
  • Loading branch information
miconda committed Apr 3, 2018
1 parent 162c304 commit a5dd60c
Showing 1 changed file with 1 addition and 0 deletions.
1 change: 1 addition & 0 deletions src/modules/ipops/ipops_mod.c
Expand Up @@ -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;
Expand Down

0 comments on commit a5dd60c

Please sign in to comment.