Skip to content

Commit

Permalink
Rename tun_config variable
Browse files Browse the repository at this point in the history
  • Loading branch information
SajjadPourali committed Apr 24, 2024
1 parent cb927c7 commit 7a49e61
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions examples/tun2.rs
Original file line number Diff line number Diff line change
Expand Up @@ -81,10 +81,10 @@ async fn main() -> Result<(), Box<dyn std::error::Error>> {
#[cfg(not(target_os = "windows"))]
let gateway = Ipv4Addr::new(10, 0, 0, 1);

let mut config = tun2::Configuration::default();
config.address(ipv4).netmask(netmask).mtu(MTU).up();
let mut tun_config = tun2::Configuration::default();
tun_config.address(ipv4).netmask(netmask).mtu(MTU).up();
#[cfg(not(target_os = "windows"))]
config.destination(gateway); // avoid routing all traffic to tun on Windows platform
tun_config.destination(gateway); // avoid routing all traffic to tun on Windows platform

#[cfg(target_os = "linux")]
tun_config.platform_config(|p_cfg| {
Expand Down

0 comments on commit 7a49e61

Please sign in to comment.