|
@@ -254,8 +254,7 @@ hash_ipportnet4_uadt(struct ip_set *set, struct nlattr *tb[],
|
|
|
|
|
|
if (cidr > 32)
|
|
|
return -IPSET_ERR_INVALID_CIDR;
|
|
|
- ip &= ip_set_hostmask(cidr);
|
|
|
- ip_to = ip | ~ip_set_hostmask(cidr);
|
|
|
+ ip_set_mask_from_to(ip, ip_to, cidr);
|
|
|
}
|
|
|
|
|
|
port_to = port = ntohs(data.port);
|
|
@@ -273,8 +272,7 @@ hash_ipportnet4_uadt(struct ip_set *set, struct nlattr *tb[],
|
|
|
if (ip2_from + UINT_MAX == ip2_to)
|
|
|
return -IPSET_ERR_HASH_RANGE;
|
|
|
} else {
|
|
|
- ip2_from &= ip_set_hostmask(data.cidr);
|
|
|
- ip2_to = ip2_from | ~ip_set_hostmask(data.cidr);
|
|
|
+ ip_set_mask_from_to(ip2_from, ip2_to, data.cidr);
|
|
|
}
|
|
|
|
|
|
if (retried)
|