fixup: make pcap read from the file
authorTobias Mueller <tobiasmue@gnome.org>
Thu, 13 Jan 2011 15:51:01 +0000 (16:51 +0100)
committerTobias Mueller <tobiasmue@gnome.org>
Thu, 13 Jan 2011 15:51:01 +0000 (16:51 +0100)
pwnitter.py

index 6995b0a..6b176f1 100755 (executable)
@@ -41,9 +41,11 @@ class Pwnitter(dbus.service.Object):
                          in_signature='', out_signature='')
     def Start(self, filename=None):
         # FIXME: Prevent double Start()
                          in_signature='', out_signature='')
     def Start(self, filename=None):
         # FIXME: Prevent double Start()
-        device = self.device
         if filename is None: # Then we do *not* want to read from a PCap file but rather a monitor device
             self.setup_monitor(device)
         if filename is None: # Then we do *not* want to read from a PCap file but rather a monitor 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)
         self.is_running = True
         try:
             self.cap = pcap.pcap(device)