Skip to content

Commit

Permalink
Only set segment_size if it is different from the transmit length
Browse files Browse the repository at this point in the history
  • Loading branch information
thomaseizinger authored and Ralith committed Nov 19, 2024
1 parent c613edf commit 9386cde
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion quinn-udp/src/unix.rs
Original file line number Diff line number Diff line change
Expand Up @@ -593,7 +593,12 @@ fn prepare_msg(
encoder.push(libc::IPPROTO_IPV6, libc::IPV6_TCLASS, ecn);
}

if let Some(segment_size) = transmit.segment_size {
// Only set the segment size if it is different from the size of the contents.
// Some network drivers don't like being told to do GSO even if there is effectively only a single segment.
if let Some(segment_size) = transmit
.segment_size
.filter(|segment_size| *segment_size != transmit.contents.len())
{
gso::set_segment_size(&mut encoder, segment_size as u16);
}

Expand Down

0 comments on commit 9386cde

Please sign in to comment.