Skip to content

Commit 53a021b

Browse files
committed
fix(vmm): pass passt port specs individually to avoid parser limit
Use separate --tcp-ports/--udp-ports arguments per port spec instead of comma-joining them, which could exceed passt's argument parser limit with large port ranges.
1 parent 3967eff commit 53a021b

1 file changed

Lines changed: 7 additions & 6 deletions

File tree

vmm/src/app/qemu.rs

Lines changed: 7 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -382,13 +382,14 @@ impl VmConfig {
382382
Protocol::Udp => udp_ports.push(port_spec),
383383
}
384384
}
385-
// Add TCP port forwarding if any
386-
if !tcp_ports.is_empty() {
387-
passt_cmd.arg("--tcp-ports").arg(tcp_ports.join(","));
385+
// Add TCP port forwarding — one --tcp-ports per spec to avoid
386+
// exceeding passt's single-argument parser limit.
387+
for spec in &tcp_ports {
388+
passt_cmd.arg("--tcp-ports").arg(spec);
388389
}
389-
// Add UDP port forwarding if any
390-
if !udp_ports.is_empty() {
391-
passt_cmd.arg("--udp-ports").arg(udp_ports.join(","));
390+
// Add UDP port forwarding
391+
for spec in &udp_ports {
392+
passt_cmd.arg("--udp-ports").arg(spec);
392393
}
393394
passt_cmd.arg("-f").arg("-1");
394395

0 commit comments

Comments
 (0)