wpaspy: Handle DETACH response more robustly
authorJouni Malinen <jouni@qca.qualcomm.com>
Mon, 28 Apr 2014 12:31:25 +0000 (15:31 +0300)
committerJouni Malinen <j@w1.fi>
Mon, 28 Apr 2014 13:54:09 +0000 (16:54 +0300)
commit19318861a527bf09f6deb02579597d4e95aaeeb4
treea29049892ad910d1480b0cae8a6a6a27dc999636
parentb7a6702fd47e82af0f5bb4a4444e46d3f25eaefa
wpaspy: Handle DETACH response more robustly

There could be pending unsolicited event messages on the monitor socket
when the DETACH command is issued. As such, the response may be
something else then OK even if the actual detach operation succeeded.
Try to avoid this be dropping pending messages before issuing the detach
command. As an additional workaround, check the response against FAIL
instead of requiring OK so that the self.attached does not get left to
True incorrectly even if an additional event message were to be
received.

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