Skip to content

Commit 2675bd1

Browse files
authored
fix(s2n-quic-dc): include ipv6 header length in MAX_TOTAL_IPV6 payload length (#2727)
1 parent 10c973d commit 2675bd1

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

dc/s2n-quic-dc/src/msg/segment.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -46,8 +46,8 @@ const MAX_TOTAL_IPV4: u16 = if cfg!(target_os = "linux") {
4646

4747
/// The maximum payload allowed in sendmsg calls using IPv6+UDP
4848
const MAX_TOTAL_IPV6: u16 = if cfg!(target_os = "linux") {
49-
// IPv6 doesn't include the IP header size in the calculation
50-
u16::MAX - UDP_HEADER_LEN
49+
// The IPV6_HEADER_LEN is required in this calculation to accommodate older kernels (such as kernel 5.10)
50+
u16::MAX - IPV6_HEADER_LEN - UDP_HEADER_LEN
5151
} else {
5252
9001 - IPV6_HEADER_LEN - UDP_HEADER_LEN
5353
};

0 commit comments

Comments
 (0)