]> git.ipfire.org Git - thirdparty/hostap.git/commitdiff
tests: Allow dump_monitor() to be used without global monitor interface
authorJouni Malinen <jouni@qca.qualcomm.com>
Thu, 18 Dec 2014 14:00:25 +0000 (16:00 +0200)
committerJouni Malinen <j@w1.fi>
Thu, 18 Dec 2014 14:01:41 +0000 (16:01 +0200)
It is possible for WpaSupplicant instance to be used without the global
control socket, so allow dump_monitor() to handle this case cleanly.

Signed-off-by: Jouni Malinen <jouni@qca.qualcomm.com>
tests/hwsim/wpasupplicant.py

index d3a9e804d7caa21dab657dbf63f5ea3e03cb16b0..38217d00804d92ef85b8c5dc4edfee0961ff25cf 100644 (file)
@@ -30,6 +30,8 @@ class WpaSupplicant:
             self.global_ctrl = wpaspy.Ctrl(global_iface)
             self.global_mon = wpaspy.Ctrl(global_iface)
             self.global_mon.attach()
+        else:
+            self.global_mon = None
 
     def set_ifname(self, ifname):
         self.ifname = ifname
@@ -641,7 +643,7 @@ class WpaSupplicant:
         while self.mon.pending():
             ev = self.mon.recv()
             logger.debug(self.ifname + ": " + ev)
-        while self.global_mon.pending():
+        while self.global_mon and self.global_mon.pending():
             ev = self.global_mon.recv()
             logger.debug(self.ifname + "(global): " + ev)