wpaspy: Do not mark not-existing UNIX domain socket as UDP
os.stat(path) failure is an ambigious indication of the control
interface "path" type (UDP hostname vs. UNIX domain socket path). The
path may be a valid UNIX domain socket path, but that socket could have
been removed just before reaching here. At least the hwsim test case
concurrent_p2pcli managed to hit the "connect exception" print below
from UDP handling even when using a UNIX domain socket.
Work around incorrect determination of control interface socket type by
assuming anything starting with '/' is a UNIX domain socket and not a
hostname.
Fixes: a2c88a8025
("wpaspy: Add support for UDP connection")
Signed-off-by: Jouni Malinen <jouni@codeaurora.org>
This commit is contained in:
parent
8d80aa3fca
commit
ed14b29f38
1 changed files with 7 additions and 7 deletions
|
@ -21,11 +21,11 @@ class Ctrl:
|
|||
self.path = path
|
||||
self.port = port
|
||||
|
||||
self.udp = False
|
||||
if not path.startswith('/'):
|
||||
try:
|
||||
mode = os.stat(path).st_mode
|
||||
if stat.S_ISSOCK(mode):
|
||||
self.udp = False
|
||||
else:
|
||||
if not stat.S_ISSOCK(mode):
|
||||
self.udp = True
|
||||
except:
|
||||
self.udp = True
|
||||
|
|
Loading…
Reference in a new issue