Skip to content

Fix debian_ip not emitting IPv6 address stanzas#69687

Open
ggiesen wants to merge 3 commits into
saltstack:3006.xfrom
ggiesen:fix-46618-debian-ip-ipv6-name
Open

Fix debian_ip not emitting IPv6 address stanzas#69687
ggiesen wants to merge 3 commits into
saltstack:3006.xfrom
ggiesen:fix-46618-debian-ip-ipv6-name

Conversation

@ggiesen

@ggiesen ggiesen commented Jul 4, 2026

Copy link
Copy Markdown
Contributor

What does this PR do?

debian_ip only understood ipv6ipaddr/ipv6ipaddrs, while rh_ip uses ipv6addr/ipv6addrs; after stripping the ipv6 prefix the remaining addr/addrs had no mapping and failed validation, so no inet6 address stanza was emitted. Fix adds addr->address and addrs->addresses aliases to SALT_ATTR_TO_DEBIAN_ATTR_MAP (plus reverse-map guards and a docstring note) so both spellings resolve to the Debian address settings. Verified via direct module execution that the new test's assertions pass with the fix and fail without it (unpatched emits no address line, EQUAL False; patched matches the canonical ipv6ipaddr output, EQUAL True); note the pytest runner could not complete in this shared env because the repo's large tests/conftest.py hangs during collection, so the assertions were validated by directly invoking the identical build_interface calls against the shadowed worktree module.

What issues does this PR fix or reference?

Fixes #46618

Previous Behavior

See #46618.

New Behavior

Fix debian_ip not emitting IPv6 address stanzas. Validated by a unit test proven to fail on unpatched 3006.x and pass with the fix (confirmed by adversarial review).

Merge requirements satisfied?

  • Tests written/updated
  • Changelog

Commits signed with GPG?

No

The Debian ip module only understood ipv6ipaddr/ipv6ipaddrs, while the
Red Hat module (rh_ip) uses ipv6addr/ipv6addrs.  After the ipv6 prefix
is stripped, the remaining addr/addrs had no mapping and failed
validation, so no inet6 address stanza was emitted.  Add addr->address
and addrs->addresses aliases to SALT_ATTR_TO_DEBIAN_ATTR_MAP so both
spellings (and bare addr/addrs) resolve to the Debian address settings,
letting formulas share one set of names across distributions.

Fixes saltstack#46618
The existing PR test already exercises the direct altitude: it calls
build_interface() itself with the rh_ip-style ipv6addr/ipv6addrs kwargs,
the exact settings names network.managed forwards verbatim from SLS
kwargs. This adds the inverse guard against overcorrection from the new
bare addr/addrs map entries: on a dual-family interface the aliased
IPv6 address must stay confined to the inet6 stanza (the inet stanza
renders byte-identical to a build with no IPv6 address), and a
MAC-valued bare addr (the legacy shape network.managed remaps to hwaddr)
must still be dropped by validation rather than emitted as a bogus
address stanza. Both assertions hold with and without the source fix.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

test:full Run the full test suite

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants