Skip to content

Commit

Permalink
Allow UDP to be disabled
Browse files Browse the repository at this point in the history
  • Loading branch information
Jake-Shadle committed Jan 30, 2025
1 parent d95586c commit 7350f0f
Showing 1 changed file with 6 additions and 2 deletions.
8 changes: 6 additions & 2 deletions src/cli/service.rs
Original file line number Diff line number Diff line change
Expand Up @@ -301,7 +301,7 @@ impl Service {
impl Future<Output = crate::Result<()>>,
Option<Box<dyn FnOnce(crate::signal::ShutdownRx) + Send>>,
)> {
if !self.udp_enabled {
if !self.udp_enabled && !self.qcmp_enabled {
return Ok((either::Left(std::future::pending()), None));
}

Expand All @@ -327,6 +327,10 @@ impl Service {
}
}

if !self.udp_enabled {
return Ok((either::Left(std::future::pending()), None));
}

self.spawn_user_space_router(config.clone())
.map(|(fut, func)| (either::Right(fut), Some(func)))
}
Expand Down Expand Up @@ -394,7 +398,7 @@ impl Service {
.network_interface
.as_deref()
.map_or(xdp::NicConfig::Default, xdp::NicConfig::Name),
external_port: self.udp_port,
external_port: if self.udp_enabled { self.udp_port } else { 0 },
qcmp_port: if self.qcmp_enabled { self.qcmp_port } else { 0 },
maximum_packet_memory: self.xdp.maximum_memory,
require_zero_copy: self.xdp.force_zerocopy,
Expand Down

0 comments on commit 7350f0f

Please sign in to comment.