Changes to be committed:

modified:   src/client.rs
	modified:   src/server.rs
This commit is contained in:
Michael Wain 2024-08-10 22:06:57 +03:00
parent d89cce67b0
commit 149792eee5
2 changed files with 3 additions and 1 deletions

View File

@ -16,6 +16,7 @@ pub async fn client_mode(remote_addr: &str) -> io::Result<()> {
config.netmask("128.0.0.0");
config.destination("0.0.0.0");
config.name("tun0");
config.up();
#[cfg(target_os = "linux")]
config.platform(|config| {

View File

@ -16,6 +16,7 @@ pub async fn server_mode() -> io::Result<()> {
let mut config = tun::Configuration::default();
config.address("10.8.0.1");
config.name("tun0");
config.up();
#[cfg(target_os = "linux")]
config.platform(|config| {
@ -84,7 +85,7 @@ pub async fn server_mode() -> io::Result<()> {
info!("{:?} bytes sent to tun", len);
}
});
let tun_device_clone_second = tun_device.clone();
let mut buf = [0; 1024];
let mut tun = tun_device_clone_second.lock().await;