Skip to content

Commit

Permalink
use the same IP family for the control and data channels
Browse files Browse the repository at this point in the history
  • Loading branch information
crazyscot committed Oct 25, 2024
1 parent 321a92d commit a35120c
Showing 1 changed file with 8 additions and 1 deletion.
9 changes: 8 additions & 1 deletion src/client/control.rs
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@ use crate::{
cert::Credentials,
cli::CliArgs,
protocol::control::{ClientMessage, ClosedownReport, ServerMessage, BANNER},
util::AddressFamily,
};

/// The parameter set needed to set up the control channel
Expand All @@ -24,6 +25,7 @@ pub struct Parameters {
timeout: Duration,
bbr: bool,
iwind: Option<u64>,
family: AddressFamily,
}

impl TryFrom<&CliArgs> for Parameters {
Expand All @@ -40,6 +42,7 @@ impl TryFrom<&CliArgs> for Parameters {
timeout: args.timeout,
bbr: args.bbr,
iwind: args.initial_congestion_window,
family: args.address_family(),
})
}
}
Expand Down Expand Up @@ -92,7 +95,11 @@ impl ControlChannel {
fn launch(args: &Parameters) -> Result<Self> {
let mut server = tokio::process::Command::new("ssh");
let _ = server.kill_on_drop(true);
// TODO extra ssh options
let _ = match args.family {
AddressFamily::Any => &mut server,
AddressFamily::IPv4 => server.arg("-4"),
AddressFamily::IPv6 => server.arg("-6"),
};
let _ = server.args([
&args.remote_host,
"qcp",
Expand Down

0 comments on commit a35120c

Please sign in to comment.