Skip to content

feat(api): add IPv6 deny prefixes#3882

Open
chet wants to merge 1 commit into
NVIDIA:mainfrom
chet:gh-issue-2405
Open

feat(api): add IPv6 deny prefixes#3882
chet wants to merge 1 commit into
NVIDIA:mainfrom
chet:gh-issue-2405

Conversation

@chet

@chet chet commented Jul 23, 2026

Copy link
Copy Markdown
Contributor

deny_prefixes stopped at Ipv4Network even though FNN already renders its ACL policy by address family. This moves the site config and runtime value to IpNetwork, so the existing FNN IPv6 path can receive configured prefixes.

  • Filter every prefix that reaches deny_prefixes or deprecated_deny_prefixes at the per-DPU boundary. FNN receives both families, while ETV and Flat keep IPv4-only values, including site_fabric_prefixes folded into mutual isolation.
  • Reject overlaps with site_fabric_prefixes in either containment direction while treating IPv4 and IPv6 as separate address spaces.
  • Keep anycast_site_prefixes IPv4-only.

Tests added!

Related issues

This supports #2405

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.)

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.)

  • cargo test -p carbide-api deny_site_fabric_overlap_is_address_family_aware -- --nocapture

  • cargo test -p carbide-api-core handlers::dpu::deny_prefix_tests --lib -- --nocapture

  • cargo test -p carbide-api-core deny_prefixes_accept_both_address_families --lib

  • cargo test -p carbide-api-core anycast_site_prefixes_reject_ipv6 --lib

  • cargo make format-nightly

  • cargo make clippy

  • cargo make carbide-lints

  • cargo make check-licenses

  • cargo make check-bans

  • cargo xtask check-workspace-deps

Additional Notes

site_fabric_prefixes remains dual-stack in its dedicated wire field. Only prefixes folded into deprecated_deny_prefixes are filtered for the IPv4-only ETV and Flat compatibility path.

@chet
chet requested a review from a team as a code owner July 23, 2026 00:56
@coderabbitai

coderabbitai Bot commented Jul 23, 2026

Copy link
Copy Markdown
Contributor

Review Change Stack

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: Path: .coderabbit.yaml

Review profile: CHILL

Plan: Enterprise

Run ID: b459f4bf-1058-4dbc-be73-b6d5d2c300ce

📥 Commits

Reviewing files that changed from the base of the PR and between 932aa83 and 4e061f0.

⛔ Files ignored due to path filters (1)
  • Cargo.lock is excluded by !**/*.lock
📒 Files selected for processing (6)
  • crates/api-core/src/cfg/README.md
  • crates/api-core/src/cfg/file.rs
  • crates/api-core/src/ethernet_virtualization.rs
  • crates/api-core/src/handlers/dpu.rs
  • crates/api/Cargo.toml
  • crates/api/src/run.rs
🚧 Files skipped from review as they are similar to previous changes (5)
  • crates/api-core/src/cfg/README.md
  • crates/api-core/src/cfg/file.rs
  • crates/api/Cargo.toml
  • crates/api-core/src/ethernet_virtualization.rs
  • crates/api-core/src/handlers/dpu.rs

Summary by CodeRabbit

  • New Features
    • Added dual-stack (IPv4 + IPv6) support for deny prefixes, with FNN receiving family-specific IPv6-eligible prefixes.
  • Bug Fixes
    • Improved network prefix validation to be address-family aware, correctly handling cross-family overlap.
    • Updated legacy deny-prefix generation behavior to match virtualization type and isolation rules.
  • Tests
    • Added coverage for mixed IPv4/IPv6 parsing, per-agent deny-prefix filtering, legacy-field behavior, and overlap validation.
  • Documentation
    • Updated deny-prefix configuration docs to reflect dual-stack semantics.

Walkthrough

deny_prefixes now supports IPv4 and IPv6 networks. DPU responses filter prefixes by agent virtualization type, while network validation detects overlaps within each address family.

Changes

Dual-stack prefix handling

Layer / File(s) Summary
Dual-stack configuration contract
crates/api-core/src/cfg/file.rs, crates/api-core/src/ethernet_virtualization.rs, crates/api-core/src/cfg/README.md
Configuration and Ethernet virtualization data use IpNetwork; parsing tests cover dual-stack deny prefixes and IPv4-only anycast prefixes.
Agent-specific prefix filtering
crates/api-core/src/handlers/dpu.rs
DPU responses provide IPv4 and IPv6 prefixes to FNN agents, IPv4-only prefixes to other agents, and apply isolation behavior to deprecated fields.
Address-family-aware validation
crates/api/src/run.rs, crates/api/Cargo.toml
Prefix overlap checks use mutual containment for IPv4 and IPv6 networks, with tests covering containment, disjointness, identical prefixes, and cross-family inputs.

Estimated code review effort: 3 (Moderate) | ~25 minutes

Sequence Diagram(s)

sequenceDiagram
  participant Config
  participant API
  participant DPUHandler
  participant Agent
  Config->>API: Load IPv4 and IPv6 deny_prefixes
  API->>API: Validate address-family-aware overlaps
  API->>DPUHandler: Provide validated network configuration
  DPUHandler->>Agent: Return filtered prefixes by virtualization type
Loading

Possibly related PRs

🚥 Pre-merge checks | ✅ 5
✅ Passed checks (5 passed)
Check name Status Explanation
Title check ✅ Passed The title matches the main change: API deny prefixes now support IPv6, with broader dual-stack handling behind it.
Description check ✅ Passed The description accurately reflects the PR's dual-stack prefix changes, validation updates, and per-DPU filtering behavior.
Docstring Coverage ✅ Passed Docstring coverage is 100.00% which is sufficient. The required threshold is 80.00%.
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.
✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests

Comment @coderabbitai help to get the list of available commands.

@chet

chet commented Jul 23, 2026

Copy link
Copy Markdown
Contributor Author

@coderabbitai full_review, thanks!

@coderabbitai

coderabbitai Bot commented Jul 23, 2026

Copy link
Copy Markdown
Contributor

@chet Understood — I’ll perform a complete re-review of #3882, with particular attention to address-family boundaries, prefix-overlap validation, and compatibility behavior across FNN, ETV, and Flat.

🐇

✅ Action performed

Full review finished.

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actionable comments posted: 1

🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

Inline comments:
In `@crates/api-core/src/cfg/file.rs`:
- Around line 179-183: Update the deny_prefixes documentation to state that FNN
accepts IPv4 and IPv6 prefixes, while all non-FNN virtualizers receive IPv4
prefixes only; apply this wording in crates/api-core/src/cfg/file.rs lines
179-183 and crates/api-core/src/cfg/README.md line 29.
🪄 Autofix (Beta)

Fix all unresolved CodeRabbit comments on this PR:

  • Push a commit to this branch (recommended)
  • Create a new PR with the fixes

ℹ️ Review info
⚙️ Run configuration

Configuration used: Path: .coderabbit.yaml

Review profile: CHILL

Plan: Enterprise

Run ID: e5ba5f38-0b01-42ad-b57a-604058f06c36

📥 Commits

Reviewing files that changed from the base of the PR and between 862b66a and 932aa83.

⛔ Files ignored due to path filters (1)
  • Cargo.lock is excluded by !**/*.lock
📒 Files selected for processing (6)
  • crates/api-core/src/cfg/README.md
  • crates/api-core/src/cfg/file.rs
  • crates/api-core/src/ethernet_virtualization.rs
  • crates/api-core/src/handlers/dpu.rs
  • crates/api/Cargo.toml
  • crates/api/src/run.rs

Comment thread crates/api-core/src/cfg/file.rs
`deny_prefixes` stopped at `Ipv4Network` even though `FNN` already renders its ACL policy by address family. This moves the site config and runtime value to `IpNetwork`, so the existing `FNN` IPv6 path can receive configured prefixes.

- Filter every prefix that reaches `deny_prefixes` or `deprecated_deny_prefixes` at the per-DPU boundary. `FNN` receives both families, while `ETV` and `Flat` keep IPv4-only values, including `site_fabric_prefixes` folded into mutual isolation.
- Reject overlaps with `site_fabric_prefixes` in either containment direction while treating IPv4 and IPv6 as separate address spaces.
- Keep `anycast_site_prefixes` IPv4-only.

Tests added!

This supports NVIDIA#2405

Signed-off-by: Chet Nichols III <chetn@nvidia.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.

1 participant