M0dEx / quincy

QUIC-based VPN
MIT License
84 stars 7 forks source link

fix(client): fetch maximum datagram size after TUN read #24

Closed M0dEx closed 9 months ago

M0dEx commented 9 months ago

This PR fixes a race condition where fetching the maximum datagram size limit occurred too soon (before reading from the TUN interface) causing the limit to be too old (and in some high-throughput cases, incorrect, due to congestion) when connection.send_datagram was called, which resulted in the datagram being rejected by the QUIC connection leading to an unrecoverable error.

By moving the fetch right before the size check and the connection.send_datagram, this error is now recoverable, as MTU path discovery updates the maximum MTU to a reasonable value after some time passes (from my testing about 15 seconds, depending on the 'length' of the connection).