Skip to content

Commit 37877d5

Browse files
committed
fix ControlMessageOwned::UdpGroSegments UDP packets processing type.
The kernel, since 5.0, process the segmentation offload with a signed int. close #2403.
1 parent ec4beb5 commit 37877d5

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

src/sys/socket/mod.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -773,7 +773,7 @@ pub enum ControlMessageOwned {
773773
#[cfg(target_os = "linux")]
774774
#[cfg(feature = "net")]
775775
#[cfg_attr(docsrs, doc(cfg(feature = "net")))]
776-
UdpGroSegments(u16),
776+
UdpGroSegments(i32),
777777

778778
/// SO_RXQ_OVFL indicates that an unsigned 32 bit value
779779
/// ancilliary msg (cmsg) should be attached to recieved
@@ -949,7 +949,7 @@ impl ControlMessageOwned {
949949
#[cfg(target_os = "linux")]
950950
#[cfg(feature = "net")]
951951
(libc::SOL_UDP, libc::UDP_GRO) => {
952-
let gso_size: u16 = unsafe { ptr::read_unaligned(p as *const _) };
952+
let gso_size: i32 = unsafe { ptr::read_unaligned(p as *const _) };
953953
ControlMessageOwned::UdpGroSegments(gso_size)
954954
},
955955
#[cfg(any(linux_android, target_os = "fuchsia"))]

0 commit comments

Comments
 (0)