[PATCH v4 23/29] wpaspy: add terminate support

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



This will terminate wpa_supplicant/hostapd

Signed-off-by: Janusz Dziedzic <janusz.dziedzic@xxxxxxxxx>
---
 wpaspy/wpaspy.py | 10 ++++++++++
 1 file changed, 10 insertions(+)

diff --git a/wpaspy/wpaspy.py b/wpaspy/wpaspy.py
index 7d6fadf..2b336a5 100644
--- a/wpaspy/wpaspy.py
+++ b/wpaspy/wpaspy.py
@@ -196,6 +196,16 @@ class Ctrl:
             return None
         raise Exception("DETACH failed")
 
+    def terminate(self):
+        if self.attached:
+            try:
+                self.detach()
+            except Exception, e:
+                # Need to ignore this allow the socket to be closed
+                self.attached = False
+        self.request("TERMINATE")
+        self.close()
+
     def pending(self, timeout=0):
         [r, w, e] = select.select([self.s], [], [], timeout)
         if r:
-- 
1.9.1


_______________________________________________
Hostap mailing list
Hostap@xxxxxxxxxxxxxxxxxxx
http://lists.infradead.org/mailman/listinfo/hostap



[Index of Archives]     [Linux Wireless]     [Linux Kernel]     [ATH6KL]     [Linux Bluetooth]     [Linux Netdev]     [Kernel Newbies]     [IDE]     [Security]     [Git]     [Netfilter]     [Bugtraq]     [Yosemite News]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Linux ATA RAID]     [Samba]     [Device Mapper]

  Powered by Linux