tun2proxy / rust-tun

TUN device creation and handling.
https://docs.rs/tun2/
30 stars 13 forks source link

Suggestion: Changing the type of mtu from usize to u16 #36

Closed SajjadPourali closed 5 months ago

SajjadPourali commented 5 months ago

As the tun interface operates on the network layer and above, I am not aware of any protocol that allows carrying more than 2^16 bytes in a single packet, which is the maximum value for an IP packet. The current implementation may lead some developers to choose the wrong value. Therefore, I suggest changing the mtu variable type from usize to u16 to prevent potential mistakes by developers.

xmh0511 commented 5 months ago

Fixed by https://github.com/ssrlive/rust-tun/pull/38