Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

wsdiscover fails when wireguard vpn is running #41

Closed
tom24 opened this issue Apr 20, 2021 · 1 comment
Closed

wsdiscover fails when wireguard vpn is running #41

tom24 opened this issue Apr 20, 2021 · 1 comment

Comments

@tom24
Copy link
Contributor

tom24 commented Apr 20, 2021

Setup: ubuntu 18.04, wireguard vpn session active on udp port 51820 (wireguard default).

$ wsdiscover
Exception in thread Thread-1:
Traceback (most recent call last):   
  File "/usr/lib/python3.6/threading.py", line 916, in _bootstrap_inner
    self.run()
  File "/usr/local/lib/python3.6/dist-packages/wsdiscovery/threaded.py", line 150, in run
    self._sendPendingMessages()
  File "/usr/local/lib/python3.6/dist-packages/wsdiscovery/threaded.py", line 226, in _sendPendingMessages
    self._sendMsg(msg)
  File "/usr/local/lib/python3.6/dist-packages/wsdiscovery/threaded.py", line 213, in _sendMsg
    sock.sendto(data, (msg.getAddr(), msg.getPort()))
OSError: [Errno 126] Required key not available


Discovered:

$

Temporary fix near line 213 of threaded.py. When patched, good results are obtained even with vpn running.

        for sock in list(self._multiOutUniInSockets.values()):
            # hack to work with wireguard
            try:
                sock.sendto(data, (msg.getAddr(), msg.getPort()))
            except:
                pass
            if self._capture:

If the vpn session is stopped, then wsdiscover works without error.

@andreikop
Copy link
Owner

Fixed by #42

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants