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 and zonyitoo committed Feb 19, 2024
1 parent c337e4e commit c550cdf
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 @@ -1625,6 +1625,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 c550cdf

Please sign in to comment.