Component
utils / network
Problem description
IPv6NetworkUtils.isIpv6RangeOverlap catches every exception from parsing/building the ranges and returns true.
Relevant code:
https://github.com/ZSvirt/zsvirt/blob/main/utils/src/main/java/org/zstack/utils/network/IPv6NetworkUtils.java#L202-L214
Malformed addresses and reversed ranges are therefore reported as overlapping. Callers use this predicate while validating or selecting networks, so invalid data can produce false conflict errors and mask the original input problem.
Steps to reproduce
Call IPv6NetworkUtils.isIpv6RangeOverlap with a malformed address or with a reversed range such as 2001:db8::10-2001:db8::2.
Expected behavior
Invalid input should not be reported as an overlap. The method should either reject invalid input consistently with the other validation helpers or return false after logging/validation.
Proposed fix
Validate the four addresses and return false for invalid/reversed ranges, or expose a throwing validation variant and keep the boolean predicate strict. Add regression tests for malformed and reversed ranges.
Component
utils / network
Problem description
IPv6NetworkUtils.isIpv6RangeOverlapcatches every exception from parsing/building the ranges and returnstrue.Relevant code:
https://github.com/ZSvirt/zsvirt/blob/main/utils/src/main/java/org/zstack/utils/network/IPv6NetworkUtils.java#L202-L214
Malformed addresses and reversed ranges are therefore reported as overlapping. Callers use this predicate while validating or selecting networks, so invalid data can produce false conflict errors and mask the original input problem.
Steps to reproduce
Call
IPv6NetworkUtils.isIpv6RangeOverlapwith a malformed address or with a reversed range such as2001:db8::10-2001:db8::2.Expected behavior
Invalid input should not be reported as an overlap. The method should either reject invalid input consistently with the other validation helpers or return
falseafter logging/validation.Proposed fix
Validate the four addresses and return
falsefor invalid/reversed ranges, or expose a throwing validation variant and keep the boolean predicate strict. Add regression tests for malformed and reversed ranges.