Skip to content

Commit

Permalink
Merge pull request #17 from xmh0511/v2
Browse files Browse the repository at this point in the history
fix mtu for windows
  • Loading branch information
xmh0511 authored Jan 22, 2024
2 parents 11c6c2f + bcdbcbc commit f8f6598
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 2 deletions.
2 changes: 1 addition & 1 deletion Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[package]
name = "tun2"
version = "0.7.21"
version = "0.7.22"
edition = "2021"

authors = ["meh. <meh@schizofreni.co>", "@ssrlive"]
Expand Down
5 changes: 4 additions & 1 deletion src/configuration.rs
Original file line number Diff line number Diff line change
Expand Up @@ -92,7 +92,10 @@ impl Configuration {

/// Set the MTU.
pub fn mtu(&mut self, value: i32) -> &mut Self {
self.mtu = Some(value);
// mtu on windows platform is always 65535 due to wintun
if cfg!(target_family = "unix") {
self.mtu = Some(value);
}
self
}

Expand Down

0 comments on commit f8f6598

Please sign in to comment.