fix: lacnic_process_query returns partial result when no address range - #53
Draft
Koan-Bot wants to merge 1 commit into
Draft
fix: lacnic_process_query returns partial result when no address range#53Koan-Bot wants to merge 1 commit into
Koan-Bot wants to merge 1 commit into
Conversation
A LACNIC response can be valid even without an inetnum/inet6num field (e.g. a top-level org entry that has country info but no IP range). The previous early-return was too aggressive — it discarded the entire result, setting permission to undef. Remove the early return so that permission, descr, netname, source, and country are always populated when the country is resolvable. CIDR is only set when an address range is actually present. The previously-deleted test 'handles missing inetnum' is restored; the contradictory 'rejects missing inetnum and inet6num' test (which was added in the same commit that deleted the original) is replaced. Fixes atoomic#52 Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
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
lacnic_process_queryhad an overly-aggressive early return that discarded the entire result when noinetnumorinet6numwas present. A LACNIC response can be valid without an IP range (e.g. a top-level org entry with country info), sopermission,descr,netname,source, andcountryshould still be populated in that case —cidris simply not set.Fixes #52
Changes
return () if !$query{inetnum} && !$query{inet6num}fromlacnic_process_query'handles missing inetnum'that documented this behavior'rejects missing inetnum and inet6num'test that was added when the original was incorrectly deletedTest plan
t/07-query-processing.tnow passes thelacnic_process_querysubtest cleanlyt/00-load.tversion check fails, which is expected in dev checkouts)Generated by Kōan /fix
Quality Report
Changes: 2 files changed, 3 insertions(+), 4 deletions(-)
Code scan: clean
Tests: failed (5 Failed, 1 test)
Branch hygiene: clean
Generated by Kōan post-mission quality pipeline