From 000c2b44bd795fb5ff9244aa6db72f223f431516 Mon Sep 17 00:00:00 2001 From: jtpereyda Date: Fri, 14 Aug 2015 07:54:01 -0700 Subject: [PATCH] Fixed open_live call to pass 65535 as the maximum packet length instead of -1. -1 was interpreted in a helpful way on some platforms but not on others. 65535 is cross-platform. --- network_monitor.py | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/network_monitor.py b/network_monitor.py index e9fcfa5..73f034e 100644 --- a/network_monitor.py +++ b/network_monitor.py @@ -10,6 +10,8 @@ import signal from sulley import pedrpc +MAX_PACKET_LENGTH = 65535 # Max packet length for IP capture + def log_error(message=None): try: @@ -174,7 +176,7 @@ def pre_send (self, test_number): self.log("initializing capture for test case #%d" % test_number) # open the capture device and set the BPF filter. - self.pcap = pcapy.open_live(self.device, -1, 1, 100) + self.pcap = pcapy.open_live(self.device, MAX_PACKET_LENGTH, 1, 100) self.pcap.setfilter(self.filter) # instantiate the capture thread.