CASMNET-2389 - Hill cabinet SLS entries contain <nil> gateway and empty CIDR#551
Merged
Conversation
After the CASMNET-2310 IPv6 refactor, IPSubnet.CIDR changed from net.IPNet (zero value .String() returns "<nil>") to a plain string (zero value is ""). The subnet-not-found guard was updated to: if subnet.CIDR != "<nil>" but this is always true when CIDR is an empty string, so every failed subnet lookup now writes a bad entry instead of being skipped. For Hill cabinets the symptom is particularly visible: the network lookup loop runs NMN → HMN → NMN_MTN → HMN_MTN → NMN_RVR → HMN_RVR. The _MTN lookups succeed and write correct cabinet network data, but the _RVR lookups that follow return empty subnets (CIDR=""), pass the broken guard, and overwrite the good MTN data with {CIDR:"", Gateway:"<nil>"} — which is serialised as \u003cnil\u003e in JSON. Fix by checking for an empty string instead: if subnet.CIDR != "" Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
jpdavis-prof
approved these changes
Apr 29, 2026
rustydb
approved these changes
Apr 29, 2026
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 and Scope
<nil>gateway and empty CIDRIssue Type
The CASMNET-2310 IPv6 refactor changed
IPSubnet.CIDRfromnet.IPNetto a plainstring, but the subnet-not-found guard inGenCabinetMapwas not updated to match. The old guard relied onnet.IPNet's zero-value.String()returning"<nil>":After the refactor,
CIDRis astringwhose zero value is"", making the updated guard:This means every failed subnet lookup writes a bad entry instead of being skipped. For Hill cabinets the effect is compounded by the network lookup loop ordering (
NMN → HMN → NMN_MTN → HMN_MTN → NMN_RVR → HMN_RVR): the_MTNlookups succeed and write correct data, but the_RVRlookups that follow return empty subnets, pass the broken guard, and overwrite the good data — producing{CIDR: "", Gateway: "\u003cnil\u003e"}in the generatedsls_input_file.json.The fix is a one-line change:
Testing
Verified against the odin system (
hpc-shasta-system-configs/odin/1.7) which has one Hill cabinet (x9000).Before fix —
sls_input_file.jsoncontained:After fix —
sls_input_file.jsoncorrectly contains:CIDR and Gateway values match the corresponding
HMN_MTNandNMN_MTNsubnet entries in the same file. VLAN IDs match those defined incabinets.yaml(hmn-vlan: 3000,nmn-vlan: 2000).Prerequisites
Idempotency
GenCabinetMapis a pure data-transformation function with no side effects. Runningcsi config initmultiple times with the same inputs will produce consistent, correct SLS cabinet network entries after this fix.Risks and Mitigations
Low risk — the change is a single character correction to a guard condition, restoring the behaviour that existed before the CASMNET-2310 refactor. The fix only affects cases where a subnet genuinely does not exist in a given network (e.g. looking up a Hill cabinet subnet in the base
HMN/NMNnetworks), and prevents bad data from being written in those cases. No valid subnet entries are affected.