Skip to content

Commit

Permalink
MTU issues in windows
Browse files Browse the repository at this point in the history
  • Loading branch information
ssrlive committed Nov 9, 2024
1 parent 1cef624 commit da545a8
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions src/platform/windows/device.rs
Original file line number Diff line number Diff line change
Expand Up @@ -64,14 +64,14 @@ impl Device {
if let Some(dns_servers) = &config.platform_config.dns_servers {
adapter.set_dns_servers(dns_servers)?;
}
let mtu = config.mtu.unwrap_or(crate::DEFAULT_MTU);

if let Some(mtu) = config.mtu {
adapter.set_mtu(mtu as _)?;
}
let capacity = config.ring_capacity.unwrap_or(MAX_RING_CAPACITY);
let session = adapter.start_session(capacity)?;
adapter.set_mtu(mtu as _)?;
let mut device = Device {
driver: Driver::Tun(Tun { session }),
mtu,
mtu: adapter.get_mtu()? as u16,
};

// This is not needed since we use netsh to set the address.
Expand Down

0 comments on commit da545a8

Please sign in to comment.