Skip to content

Commit 3498b96

Browse files
davidv1992tdittr
authored andcommitted
Supress packet truncation warning when we aren't intrested in the packet
anyway.
1 parent 8bfa7a1 commit 3498b96

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

src/raw_socket.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -137,7 +137,7 @@ impl RawSocket {
137137
}
138138
};
139139

140-
if mhdr.msg_flags & libc::MSG_TRUNC > 0 {
140+
if mhdr.msg_flags & libc::MSG_TRUNC > 0 && !packet_buf.is_empty() {
141141
tracing::info!(
142142
"truncated packet because it was larger than expected: {} bytes",
143143
packet_buf.len(),

0 commit comments

Comments
 (0)