Skip to content
Open
Show file tree
Hide file tree
Changes from 36 commits
Commits
Show all changes
37 commits
Select commit Hold shift + click to select a range
f9bc169
.
Oct 16, 2025
83b3cee
Merge branch 'main' into proc_topology
Oct 16, 2025
3600e7a
wip
Oct 30, 2025
87cf158
Merge branch 'main' of https://github.com/microsoft/openvmm
damanm24 Oct 30, 2025
bedd466
Merge branch 'main' of https://github.com/microsoft/openvmm
damanm24 Nov 4, 2025
01fe341
Merge branch 'main' into consomme_ipv6
Nov 4, 2025
8acde53
wip
Nov 5, 2025
bc383e2
Finish UDP over IPv6 and DNS on unix
Nov 5, 2025
c60bd6d
Use AF_UNSPEC for 1 syscall instead
damanm24 Nov 6, 2025
116b411
Merge branch 'main' of https://github.com/microsoft/openvmm
damanm24 Nov 6, 2025
2bc543b
checkpt
damanm24 Nov 7, 2025
30dac28
Remove un-needed message handling for DHCPv6
damanm24 Nov 7, 2025
99b277d
checkpt
damanm24 Nov 7, 2025
441db93
Windows guest recognizes IPv6 capabilities
damanm24 Nov 7, 2025
f5b97f1
minor changes
damanm24 Nov 10, 2025
a77bea0
Merge branch 'main' of https://github.com/microsoft/openvmm
damanm24 Nov 10, 2025
2b57eea
Use already existing types
damanm24 Nov 11, 2025
cb23c36
checkpt
damanm24 Nov 11, 2025
dd84e24
bit of cleanup
damanm24 Nov 12, 2025
36c6cb5
Prepare for review
damanm24 Nov 12, 2025
31b7a60
More cleanup
damanm24 Nov 12, 2025
b439e0e
update comment with accurate default network state
damanm24 Nov 12, 2025
423a20b
Clippy + xtask fixes
Nov 12, 2025
235da5e
checkpt
damanm24 Nov 14, 2025
ab27f38
minor changes
damanm24 Nov 14, 2025
9121770
Merge branch 'main' of https://github.com/microsoft/openvmm
damanm24 Nov 14, 2025
4493f2b
Merge branch 'main' into consomme_ipv6
damanm24 Nov 14, 2025
6f56fbf
Merge branch 'consomme_ipv6' of https://github.com/damanm24/openvmm i…
damanm24 Nov 14, 2025
6bedac1
clippy fixes
damanm24 Nov 17, 2025
6a01be6
remove dhcproto dep
damanm24 Nov 17, 2025
1b78011
undo
damanm24 Nov 17, 2025
e1c2455
.
damanm24 Nov 17, 2025
2dc273d
.
damanm24 Nov 18, 2025
6fdce76
Merge branch 'main' into consomme_ipv6
damanm24 Dec 10, 2025
9577aa8
Address feedback
damanm24 Dec 15, 2025
9005164
Update bind_port fn
Dec 16, 2025
6e43b51
Address comments
Dec 16, 2025
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
119 changes: 117 additions & 2 deletions Cargo.lock
Original file line number Diff line number Diff line change
Expand Up @@ -197,6 +197,15 @@ dependencies = [
"syn 2.0.106",
]

[[package]]
name = "atomic-polyfill"
version = "1.0.3"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "8cf2bce30dfe09ef0bfaef228b9d414faaf7e563035494d7fe092dba54b300f4"
dependencies = [
"critical-section",
]

[[package]]
name = "atomic-waker"
version = "1.1.2"
Expand Down Expand Up @@ -768,6 +777,7 @@ version = "0.0.0"
dependencies = [
"futures",
"getrandom 0.3.3",
"heapless",
"inspect",
"inspect_counters",
"libc",
Expand All @@ -776,8 +786,10 @@ dependencies = [
"smoltcp",
"socket2",
"thiserror 2.0.16",
"tracelimit",
"tracing",
"windows-sys 0.61.0",
"zerocopy 0.8.27",
]

[[package]]
Expand Down Expand Up @@ -878,6 +890,12 @@ dependencies = [
"itertools 0.13.0",
]

[[package]]
name = "critical-section"
version = "1.2.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "790eea4361631c5e7d22598ecd5723ff611904e3344ce8720784c93e3d83d40b"

[[package]]
name = "crossbeam-deque"
version = "0.8.6"
Expand Down Expand Up @@ -995,6 +1013,47 @@ dependencies = [
"vmsocket",
]

[[package]]
name = "defmt"
version = "0.3.100"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "f0963443817029b2024136fc4dd07a5107eb8f977eaf18fcd1fdeb11306b64ad"
dependencies = [
"defmt 1.0.1",
]

[[package]]
name = "defmt"
version = "1.0.1"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "548d977b6da32fa1d1fda2876453da1e7df63ad0304c8b3dae4dbe7b96f39b78"
dependencies = [
"bitflags 1.3.2",
"defmt-macros",
]

[[package]]
name = "defmt-macros"
version = "1.0.1"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "3d4fc12a85bcf441cfe44344c4b72d58493178ce635338a3f3b78943aceb258e"
dependencies = [
"defmt-parser",
"proc-macro-error2",
"proc-macro2",
"quote",
"syn 2.0.106",
]

[[package]]
name = "defmt-parser"
version = "1.0.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "10d60334b3b2e7c9d91ef8150abfb6fa4c1c39ebbcf4a81c2e346aad939fee3e"
dependencies = [
"thiserror 2.0.16",
]

[[package]]
name = "der"
version = "0.7.10"
Expand Down Expand Up @@ -2796,6 +2855,15 @@ dependencies = [
"crunchy",
]

[[package]]
name = "hash32"
version = "0.2.1"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "b0c35f58762feb77d74ebe43bdbc3210f09be9fe6742234d573bacc26ed92b67"
dependencies = [
"byteorder",
]

[[package]]
name = "hashbrown"
version = "0.15.5"
Expand Down Expand Up @@ -2885,6 +2953,19 @@ dependencies = [
name = "headervec"
version = "0.0.0"

[[package]]
name = "heapless"
version = "0.7.17"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "cdc6457c0eb62c71aac4bc17216026d8410337c4126773b9c5daba343f17964f"
dependencies = [
"atomic-polyfill",
"hash32",
"rustc_version",
"spin 0.9.8",
"stable_deref_trait",
]

[[package]]
name = "heck"
version = "0.4.1"
Expand Down Expand Up @@ -5979,6 +6060,28 @@ dependencies = [
"syn 1.0.109",
]

[[package]]
name = "proc-macro-error-attr2"
version = "2.0.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "96de42df36bb9bba5542fe9f1a054b8cc87e172759a1868aa05c1f3acc89dfc5"
dependencies = [
"proc-macro2",
"quote",
]

[[package]]
name = "proc-macro-error2"
version = "2.0.1"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "11ec05c52be0a07b08061f7dd003e7d7092e0472bc731b4af7bb1ef876109802"
dependencies = [
"proc-macro-error-attr2",
"proc-macro2",
"quote",
"syn 2.0.106",
]

[[package]]
name = "proc-macro2"
version = "1.0.101"
Expand Down Expand Up @@ -6855,12 +6958,15 @@ checksum = "67b1b7a3b5fe4f1376887184045fcf45c69e92af734b7aaddc05fb777b6fbd03"

[[package]]
name = "smoltcp"
version = "0.8.2"
version = "0.9.1"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "ee34c1e1bfc7e9206cc0fb8030a90129b4e319ab53856249bb27642cab914fb3"
checksum = "7e9786ac45091b96f946693e05bfa4d8ca93e2d3341237d97a380107a6b38dea"
dependencies = [
"bitflags 1.3.2",
"byteorder",
"cfg-if",
"defmt 0.3.100",
"heapless",
"managed",
]

Expand Down Expand Up @@ -6893,6 +6999,9 @@ name = "spin"
version = "0.9.8"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "6980e8d7511241f8acf4aebddbb1ff938df5eebe98691418c4468d0b72a96a67"
dependencies = [
"lock_api",
]

[[package]]
name = "spin"
Expand Down Expand Up @@ -6922,6 +7031,12 @@ dependencies = [
"der",
]

[[package]]
name = "stable_deref_trait"
version = "1.2.1"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "6ce2be8dc25455e1f91df71bfa12ad37d7af1092ae736f3a6cd0e37bc7810596"

[[package]]
name = "stackfuture"
version = "0.3.0"
Expand Down
3 changes: 2 additions & 1 deletion Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -451,6 +451,7 @@ gptman = "2.0"
grep-regex = "0.1"
grep-searcher = "0.1"
h2 = "0.4"
heapless = "0.7.16"
heck = "0.5"
hex = "0.4"
http = "1"
Expand Down Expand Up @@ -524,7 +525,7 @@ signal-hook = { version = "0.3", default-features = false }
slab = "0.4"
smallbox = "0.8"
smallvec = "1.8"
smoltcp = { version = "0.8", default-features = false }
smoltcp = { version = "0.9", default-features = false }
socket2 = "0.6"
spin = "0.10.0"
stackfuture = "0.3"
Expand Down
5 changes: 4 additions & 1 deletion vm/devices/net/net_consomme/consomme/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -7,16 +7,19 @@ edition.workspace = true
rust-version.workspace = true

[dependencies]
heapless.workspace = true
inspect.workspace = true
inspect_counters.workspace = true
pal_async.workspace = true

futures.workspace = true
getrandom.workspace = true
smoltcp = { workspace = true, features = [ "proto-ipv4", "medium-ethernet", "socket-raw", "std", "proto-dhcpv4" ] }
smoltcp = { workspace = true, features = [ "proto-ipv4", "proto-ipv6", "medium-ethernet", "socket-raw", "std", "proto-dhcpv4" ] }
socket2.workspace = true
thiserror.workspace = true
tracelimit.workspace = true
tracing.workspace = true
zerocopy.workspace = true

[target.'cfg(unix)'.dependencies]
libc.workspace = true
Expand Down
28 changes: 20 additions & 8 deletions vm/devices/net/net_consomme/consomme/src/dhcp.rs
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@ use super::Client;
use super::DropReason;
use crate::ChecksumState;
use crate::MIN_MTU;
use heapless::Vec as HeaplessVec;
use smoltcp::phy::ChecksumCapabilities;
use smoltcp::wire::DHCP_MAX_DNS_SERVER_COUNT;
use smoltcp::wire::DhcpMessageType;
Expand Down Expand Up @@ -48,25 +49,29 @@ impl<T: Client> Access<'_, T> {
}

let dns_servers = if self.inner.state.params.nameservers.is_empty() {
None
let dns_servers: HeaplessVec<Ipv4Address, DHCP_MAX_DNS_SERVER_COUNT> =
HeaplessVec::new();
Some(dns_servers)
} else {
let mut dns_servers = [None; DHCP_MAX_DNS_SERVER_COUNT];
for (&s, d) in self
let dns_servers: HeaplessVec<Ipv4Address, DHCP_MAX_DNS_SERVER_COUNT> = self
.inner
.state
.params
.nameservers
.iter()
.zip(&mut dns_servers)
{
*d = Some(s);
}
.filter_map(|ip| match ip {
IpAddress::Ipv4(addr) => Some(*addr),
_ => None,
})
.take(DHCP_MAX_DNS_SERVER_COUNT)
.collect::<HeaplessVec<Ipv4Address, DHCP_MAX_DNS_SERVER_COUNT>>();
Some(dns_servers)
};

let resp_dhcp = if let Some(your_ip) = your_ip {
DhcpRepr {
message_type,
secs: 0,
transaction_id: dhcp_req.transaction_id,
client_hardware_address: dhcp_req.client_hardware_address,
client_ip: Ipv4Address::UNSPECIFIED,
Expand All @@ -83,10 +88,14 @@ impl<T: Client> Access<'_, T> {
dns_servers,
max_size: None,
lease_duration: Some(86400),
rebind_duration: None,
renew_duration: None,
additional_options: &[],
}
} else {
DhcpRepr {
message_type: DhcpMessageType::Nak,
secs: 0,
transaction_id: dhcp_req.transaction_id,
client_hardware_address: dhcp_req.client_hardware_address,
client_ip: Ipv4Address::UNSPECIFIED,
Expand All @@ -103,6 +112,9 @@ impl<T: Client> Access<'_, T> {
dns_servers: None,
max_size: None,
lease_duration: None,
rebind_duration: None,
renew_duration: None,
additional_options: &[],
}
};

Expand All @@ -113,7 +125,7 @@ impl<T: Client> Access<'_, T> {
let resp_ipv4 = Ipv4Repr {
src_addr: self.inner.state.params.gateway_ip,
dst_addr: Ipv4Address::BROADCAST,
protocol: IpProtocol::Udp,
next_header: IpProtocol::Udp,
payload_len: resp_udp.header_len() + resp_dhcp.buffer_len(),
hop_limit: 64,
};
Expand Down
Loading