def Start(self, filename=None):
# FIXME: Prevent double Start()
if filename is None: # Then we do *not* want to read from a PCap file but rather a monitor device
- self.setup_monitor(self.device)
+ self.setup_monitor(device)
+ device = self.device
+ else: # We have given a filename, so let's make PCap read from the file
+ device = filename
self.is_running = True
try:
self.cap = pcap.pcap(device)