Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 9 additions & 0 deletions tests/scripts/dual_tor_sniffer.py
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,15 @@
# by default.
socket.socket.bind = lambda *_: None
super(L2ListenAllSocket, self).__init__(*args, **kwargs)
# Increase socket receive buffer to prevent kernel packet drops.
# The default SO_RCVBUF (~128KB) is too small when all interfaces
# share a single PF_PACKET socket, brief scapy processing pauses
# cause the buffer to overflow and packets to be silently dropped.
try:
self.ins.setsockopt(socket.SOL_SOCKET, socket.SO_RCVBUF,
32 * 1024 * 1024)
except OSError:

Check notice

Code scanning / CodeQL

Empty except Note test

'except' clause does nothing but pass and there is no explanatory comment.
pass

def recv_raw(self, x=MTU):
# NOTE: override the L2ListenSocket.recv_raw to map to correct
Expand Down
Loading