Skip to content

Commit

Permalink
Parse tun_interface_destination from ssconfig
Browse files Browse the repository at this point in the history
  • Loading branch information
AzazKamaz authored Nov 11, 2023
1 parent d52a160 commit 4b51cbf
Showing 1 changed file with 11 additions and 0 deletions.
11 changes: 11 additions & 0 deletions crates/shadowsocks-service/src/config.rs
Original file line number Diff line number Diff line change
Expand Up @@ -1628,6 +1628,17 @@ impl Config {
}
}

#[cfg(feature = "local-tun")]
if let Some(tun_interface_destination) = local.tun_interface_destination {
match tun_interface_destination.parse::<IpNet>() {
Ok(addr) => local_config.tun_interface_destination = Some(addr),
Err(..) => {
let err = Error::new(ErrorKind::Malformed, "`tun_interface_destination` invalid", None);
return Err(err);
}
}
}

#[cfg(feature = "local-tun")]
if let Some(tun_interface_name) = local.tun_interface_name {
local_config.tun_interface_name = Some(tun_interface_name);
Expand Down

0 comments on commit 4b51cbf

Please sign in to comment.