Skip to content

fix: lacnic_process_query returns partial result when no address range - #53

Draft
Koan-Bot wants to merge 1 commit into
atoomic:masterfrom
Koan-Bot:koan.atoomic/fix-issue-52
Draft

fix: lacnic_process_query returns partial result when no address range#53
Koan-Bot wants to merge 1 commit into
atoomic:masterfrom
Koan-Bot:koan.atoomic/fix-issue-52

Conversation

@Koan-Bot

@Koan-Bot Koan-Bot commented Apr 29, 2026

Copy link
Copy Markdown
Contributor

Summary

lacnic_process_query had an overly-aggressive early return that discarded the entire result when no inetnum or inet6num was present. A LACNIC response can be valid without an IP range (e.g. a top-level org entry with country info), so permission, descr, netname, source, and country should still be populated in that case — cidr is simply not set.

Fixes #52

Changes

  • Remove return () if !$query{inetnum} && !$query{inet6num} from lacnic_process_query
  • Restore the original test 'handles missing inetnum' that documented this behavior
  • Replace the contradictory 'rejects missing inetnum and inet6num' test that was added when the original was incorrectly deleted

Test plan

  • t/07-query-processing.t now passes the lacnic_process_query subtest cleanly
  • All other tests continue to pass (only t/00-load.t version 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

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>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Failure from t/07-query-processing.t on CI

1 participant