Fix IPv6 diff boundary bug and update test harnesses#41
Merged
Conversation
- Fix ipset6_diff.c: always refresh lo1/hi1 and lo2/hi2 from the array after incrementing i1/i2 at the IPV6_ADDR_MAX boundary. The previous conditional refresh (lo1 > hi1) could leave stale values from the prior iteration, producing incorrect diff results for ranges ending at the maximum IPv6 address. - Use memset for addrinfo hints in ipset_dns.c for consistency with the IPv6 DNS resolver (defensive, avoids uninitialized struct fields). - Fix sanitizer test 05 and unit test harnesses: add ipset_dns.c to the compilation and define active_family/ipv6_dropped_in_ipv4_mode globals required after the DNS extraction and IPv6 additions.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Findings from 4-model parallel code review (GLM-5.1, Kimi K2.5, Qwen 3.5+, MiniMax M2.7) + ASAN/UBSAN/TSAN + valgrind memcheck.
Bug fix:
ipset6_diff.c: fix stalelo1/hi1(andlo2/hi2) afteri1++/i2++at theIPV6_ADDR_MAXboundary. The conditional refreshlo1 > hi1could leave values from the prior iteration, producing incorrect diff results for IPv6 ranges ending at the maximum address.Defensive fix:
ipset_dns.c: usememsetfor addrinfo hints struct, consistent with the IPv6 DNS resolver.Test harness fixes:
ipset_dns.cto compilation, defineactive_family/ipv6_dropped_in_ipv4_modeglobals.run-unit-tests.sh: addipset_dns.ctoPROJECT_SOURCES.Verification
Review triage
Findings verified against code, dispositioned: