Skip to content

Commit

Permalink
fix(client): fetch maximum datagram size after TUN read (#24)
Browse files Browse the repository at this point in the history
  • Loading branch information
M0dEx authored Sep 26, 2023
2 parents b5ad2fe + a11744b commit 6dfeb1a
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 4 deletions.
2 changes: 1 addition & 1 deletion Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[package]
name = "quincy"
version = "0.2.3"
version = "0.2.4"
authors = ["Jakub Kubík <[email protected]>"]
license = "MIT"
description = "QUIC-based VPN"
Expand Down
4 changes: 2 additions & 2 deletions src/client.rs
Original file line number Diff line number Diff line change
Expand Up @@ -163,12 +163,12 @@ impl QuincyClient {
debug!("Started outgoing traffic task (interface -> QUIC tunnel)");

loop {
let data = read_from_interface(&mut read_interface, interface_mtu).await?;

let quinn_mtu = connection
.max_datagram_size()
.ok_or_else(|| anyhow!("The Quincy server does not support datagram transfer"))?;

let data = read_from_interface(&mut read_interface, interface_mtu).await?;

if data.len() > quinn_mtu {
warn!(
"Dropping packet of size {} due to maximum datagram size being {}",
Expand Down

0 comments on commit 6dfeb1a

Please sign in to comment.