Skip to content

Commit

Permalink
删除多此一举的 toZeroHost , 修复前缀长度丢失
Browse files Browse the repository at this point in the history
  • Loading branch information
paulzzh committed Dec 25, 2024
1 parent 8d38a1d commit b152c8a
Showing 1 changed file with 2 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -446,7 +446,7 @@ public Collection<IPAddress> filterIP(Collection<IPAddress> ips) {
.map(ip -> {
try {
if (ip.getPrefixLength() == null && ip.isIPv6()) {
ip = ip.toPrefixBlock(ipv6ConvertToPrefixLength).toZeroHost();
ip = ip.toPrefixBlock(ipv6ConvertToPrefixLength);
}
} catch (Exception e) {
log.error("Unable to convert {} with prefix block {}.", ip, ipv6ConvertToPrefixLength, e);
Expand All @@ -463,7 +463,7 @@ public DualIPv4v6Tries filterIP(DualIPv4v6Tries ips) {
if (!ip.isLocal() && !ip.isLoopback()) {
try {
if (ip.getPrefixLength() == null && ip.isIPv6()) {
ip = ip.toPrefixBlock(ipv6ConvertToPrefixLength).toZeroHost();
ip = ip.toPrefixBlock(ipv6ConvertToPrefixLength);
}
dualIPv4v6Tries.add(ip);
} catch (Exception e) {
Expand Down

0 comments on commit b152c8a

Please sign in to comment.