meh / rust-tun

TUN device creation and handling.
343 stars 136 forks source link

fix: reserve enough space for packet decoding #23

Closed eycorsican closed 4 years ago

eycorsican commented 4 years ago

The root cause of #17 is the codec fails to reserve enough space for the every packet and resulting truncated packets.

eycorsican commented 4 years ago

The issue also affects Linux, if there's pi, and the remaining space for decoding is less than 4 bytes, InvalidInput error will be returned whenread() on the device.

meh commented 4 years ago

That makes a lot more sense, thanks!