Skip to content

Comments

fix(agent): widen basic agent config types from Ipv4Addr to IpAddr#360

Open
chet wants to merge 1 commit intoNVIDIA:mainfrom
chet:ipv6_tackling_the_agent_episode1
Open

fix(agent): widen basic agent config types from Ipv4Addr to IpAddr#360
chet wants to merge 1 commit intoNVIDIA:mainfrom
chet:ipv6_tackling_the_agent_episode1

Conversation

@chet
Copy link
Contributor

@chet chet commented Feb 22, 2026

Description

Still chipping away at IPv6 support.

Work thus far has included:

  • Moving to IpNetwork and IpAddress throughout (#192).
  • Accepting IPv6 site prefixes and network segments. (#204).
  • Making the IP allocator family-aware (#217).
  • Making the prefix allocator family-aware (#237).
  • Removing some more API guards and enhancing the IdentifyAddressFamily trait (#324).
  • Adding AAAA record support to DNS (#332).
  • Backend DHCP plumbing updates (#335).
  • Adding a new ResourcePoolType::Ipv6 type (#344).
  • Adding a new ResourcePoolType::Ipv6Prefix type (#345).

All of that work has been on the "core" side -- the API, database, allocator, DNS, resource pools, etc. This PR is the first in a new series of changes focused on the agent side. The goal is, of course, to have IPv6 support plumbed through the agent, so it can make its way to HBN (via nvue) for configuring addresses, routes, ACLs, BGP, etc.

Similar to "core" efforts, I'm taking a simple starting point by widening from Ipv4Addr to IpAddr across some of the more low-hanging agent config structs, CLI argument types, and service address types. Just like previous changes being a noop, this is no different, and the test-verified rendered template output remains the same.

Changes included:

  • InterfacesConfig.loopback_ip going from Ipv4Addr to IpAddr. This only gets used as conf.loopback_ip.to_string() to feed templates.
  • FrrConfig.loopback_ip going from Ipv4Addr to IpAddr. Same thing as above -- only used as conf.loopback_ip.to_string() to feed templates.
  • loopback_ip going from Ipv4Addr to IpAddr in NvueOptions, FrrOptions, and InterfacesOptions. Since these are all parsed via IpAddr::from_str, they continued to work as-is.
  • ServiceAddresses.pxe_ip going from Ipv4Addr to IpAddr. Despite the field name, this is the UEFI HTTP boot server address, which would carry over to DHCPv6 just fine.
  • ServiceAddresses.ntpservers going from Vec<Ipv4Addr> to Vec<IpAddr>. NTP servers are still a DHCPv6 "feature".
  • At the dhcp::build_server_config() call site, added IPv4 filtering for pxe_ip, ntpservers, and nameservers (which was already filtered) before passing to the DHCPv4 config builder. ServiceAddresses now holds both families, but DHCPv4 options can only carry IPv4 addresses.
  • Left comments on things that are intentionally staying IPv4 for now -- the DhcpOptions CLI struct (DHCPv4-specific), and the internal HBN bridge prefix parsing (169.254.x.x link-local plumbing, though an IPv6 equivalent may be needed in the future).

The existing tests (including test_write_frr) continue to pass, rendering templates as expected. IPv6 templates are NOT being introduced here yet -- for now, the important bit is widening types to IpAddr and making sure it continues to work as a drop-in with IPv4.

Signed-off-by: Chet Nichols III chetn@nvidia.com

Type of Change

  • Add - New feature or capability
  • Change - Changes in existing functionality
  • Fix - Bug fixes
  • Remove - Removed features or deprecated functionality
  • Internal - Internal changes (refactoring, tests, docs, etc.)

Related Issues (Optional)

Breaking Changes

  • This PR contains breaking changes

Testing

  • Unit tests added/updated
  • Integration tests added/updated
  • Manual testing performed
  • No testing required (docs, internal refactor, etc.)

Additional Notes

Still chipping away at [IPv6 support](NVIDIA#84).

Work thus far has included:
- Moving to `IpNetwork` and `IpAddress` throughout ([NVIDIA#192](NVIDIA#192)).
- Accepting IPv6 site prefixes and network segments. ([NVIDIA#204](NVIDIA#204)).
- Making the IP allocator family-aware ([NVIDIA#217](NVIDIA#217)).
- Making the prefix allocator family-aware ([NVIDIA#237](NVIDIA#237)).
- Removing some more API guards and enhancing the `IdentifyAddressFamily` trait ([NVIDIA#324](NVIDIA#324)).
- Adding `AAAA` record support to DNS ([NVIDIA#332](NVIDIA#332)).
- Backend DHCP plumbing updates ([NVIDIA#335](NVIDIA#335)).
- Adding a new `ResourcePoolType::Ipv6` type ([NVIDIA#344](NVIDIA#344)).
- Adding a new `ResourcePoolType::Ipv6Prefix` type ([NVIDIA#345](NVIDIA#345)).

All of that work has been on the "core" side -- the API, database, allocator, DNS, resource pools, etc. *This* PR is the first in a new series of changes focused on the agent side. The goal is, of course, to have IPv6 support plumbed through the agent, so it can make its way to HBN (via `nvue`) for configuring addresses, routes, ACLs, BGP, etc.

Similar to "core" efforts, I'm taking a simple starting point by widening from `Ipv4Addr` to `IpAddr` across some of the more low-hanging agent config structs, CLI argument types, and service address types. Just like previous changes being a noop, this is no different, and the test-verified rendered template output remains the same.

Changes included:
- `InterfacesConfig.loopback_ip` going from `Ipv4Addr` to `IpAddr`. This only gets used as `conf.loopback_ip.to_string()` to feed templates.
- `FrrConfig.loopback_ip` going from `Ipv4Addr` to `IpAddr`. Same thing as above -- only used as `conf.loopback_ip.to_string()` to feed templates.
- `loopback_ip` going from `Ipv4Addr` to `IpAddr` in `NvueOptions`, `FrrOptions`, and `InterfacesOptions`. Since these are all parsed via `IpAddr::from_str`, they continued to work as-is.
- `ServiceAddresses.pxe_ip` going from `Ipv4Addr` to `IpAddr`. Despite the field name, this is the UEFI HTTP boot server address, which would carry over to DHCPv6 just fine.
- `ServiceAddresses.ntpservers` going from `Vec<Ipv4Addr>` to `Vec<IpAddr>`. NTP servers are still a DHCPv6 "feature".
- At the `dhcp::build_server_config()` call site, added IPv4 filtering for `pxe_ip`, `ntpservers`, and `nameservers` (which was already filtered) before passing to the DHCPv4 config builder. `ServiceAddresses` now holds both families, but DHCPv4 options can only carry IPv4 addresses.
- Left comments on things that are intentionally staying IPv4 for now -- the `DhcpOptions` CLI struct (DHCPv4-specific), and the internal HBN bridge prefix parsing (`169.254.x.x` link-local plumbing, though an IPv6 equivalent may be needed in the future).

The existing tests (including `test_write_frr`) continue to pass, rendering templates as expected. IPv6 templates are NOT being introduced here yet -- for now, the important bit is widening types to `IpAddr` and making sure it continues to work as a drop-in with IPv4

Signed-off-by: Chet Nichols III <chetn@nvidia.com>
@chet chet requested a review from a team as a code owner February 22, 2026 07:50
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.

1 participant