Skip to content

Conversation

@damanm24
Copy link
Contributor

This PR adds the ability for the net_consomme backend to process IPv6 traffic generated by a guest VM. Without this change, guest VM's would only reporting having an IPv4 address and a link-local IPv6 address assigned to the machine (see the image below). However, with the addition of a minimal DHCPv6 server and handling of the Neighbor Discovery Protocol (NDP) (an extension of ICMPv6 analogous to ARP for IPv4), guest VM's are able to generate their own global unicast IPv6 addresses with SLAAC (Stateless Address Autoconfiguration).

Before:
image

After:
image

Proper handling of TCP and UDP traffic over IPv6 was validated by spinning up a netcat server on a host machine that a guest VM would connect to by using the host machines global unicast IPv6 address.

Along with adding IPv6 support, this PR also introduces some changes to remove types that were defined in the net_consomme crate and replace them with types that already exist in various dependencies.

Copilot AI review requested due to automatic review settings November 12, 2025 01:15
@damanm24 damanm24 requested review from a team as code owners November 12, 2025 01:15
@github-actions github-actions bot added the unsafe Related to unsafe code label Nov 12, 2025
@github-actions
Copy link

⚠️ Unsafe Code Detected

This PR modifies files containing unsafe Rust code. Extra scrutiny is required during review.

For more on why we check whole files, instead of just diffs, check out the Rustonomicon

@damanm24
Copy link
Contributor Author

Before this change goes in, I will update the validate_mana_nic function (in the vmm_tests) to ensure the device with a self-assigned IPv6 address.

Copilot finished reviewing on behalf of damanm24 November 12, 2025 01:19
Copy link
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull Request Overview

This PR adds IPv6 support to the net_consomme backend, enabling guest VMs to use IPv6 networking alongside existing IPv4 functionality. The implementation includes a minimal DHCPv6 server and Neighbor Discovery Protocol (NDP) handling to support Stateless Address Autoconfiguration (SLAAC).

Key changes:

  • Implements NDP (Neighbor Discovery Protocol) for IPv6 address resolution and router advertisements
  • Adds DHCPv6 server for stateless configuration (DNS server information)
  • Extends TCP and UDP handlers to process both IPv4 and IPv6 traffic
  • Replaces internal types (SocketAddress, FourTuple) with standard library types (SocketAddr, SocketAddrV4, SocketAddrV6)

Reviewed Changes

Copilot reviewed 12 out of 13 changed files in this pull request and generated 12 comments.

Show a summary per file
File Description
vm/devices/net/net_consomme/src/lib.rs Updates API to use IpAddr instead of Ipv4Addr for bind operations
vm/devices/net/net_consomme/consomme/src/lib.rs Adds IPv6 packet handling, new DHCPv6/NDP modules, and IPv6 configuration parameters
vm/devices/net/net_consomme/consomme/src/udp.rs Extends UDP handling for IPv6, replaces SocketAddress with SocketAddr
vm/devices/net/net_consomme/consomme/src/tcp.rs Extends TCP handling for IPv6, replaces custom FourTuple with typed version using SocketAddr
vm/devices/net/net_consomme/consomme/src/ndp.rs New file implementing NDP (Router/Neighbor Solicitation/Advertisement)
vm/devices/net/net_consomme/consomme/src/dhcpv6.rs New file implementing DHCPv6 InformationRequest handling
vm/devices/net/net_consomme/consomme/src/icmp.rs Updates to use SocketAddrV4 instead of custom SocketAddress
vm/devices/net/net_consomme/consomme/src/dhcp.rs Filters nameservers to only include IPv4 addresses
vm/devices/net/net_consomme/consomme/src/dns_windows.rs Extends to read both IPv4 and IPv6 DNS servers from system
vm/devices/net/net_consomme/consomme/src/dns_unix.rs Extends to parse both IPv4 and IPv6 DNS servers from resolv.conf
vm/devices/net/net_consomme/consomme/Cargo.toml Adds dhcproto dependency and enables proto-ipv6 feature for smoltcp
Cargo.toml Adds dhcproto = "0.14.0" workspace dependency
Cargo.lock Lock file updates for new dhcproto dependency and its transitive dependencies

@github-actions
Copy link

@jstarks
Copy link
Member

jstarks commented Nov 12, 2025

This is really cool.

@github-actions
Copy link

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

unsafe Related to unsafe code

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants