mike01 / pypacker

:package: The fastest and simplest packet manipulation lib for Python
GNU General Public License v2.0
251 stars 46 forks source link

[Errno 97] Address family not supported by protocol #48

Open klvbdmh opened 6 years ago

klvbdmh commented 6 years ago

I'm trying to run an example "Send and receive packets (send/receive raw bytes)" and I got the following error:

Traceback (most recent call last):
  File "capture.py", line 6, in <module>
    psock = psocket.SocketHndl(mode=psocket.SocketHndl.MODE_LAYER_2, timeout=10)
  File "/home/user/miniconda3/lib/python3.6/site-packages/pypacker/psocket.py", line 46, in __init__
    socket.htons(SocketHndl.ETH_P_ALL))
  File "/home/user/miniconda3/lib/python3.6/socket.py", line 144, in __init__
    _socket.socket.__init__(self, family, type, proto, fileno)
OSError: [Errno 97] Address family not supported by protocol

I'm using the latest version: pypacker==4.3

System info:

lsb_release -a

No LSB modules are available.
Distributor ID: Ubuntu
Description:    Ubuntu 16.04.2 LTS
Release:        16.04
Codename:       xenial
mike01 commented 6 years ago

Strange, seems like IPv6 (or something else) is not supported, fallback solution is now implemented in gitlab repo at https://gitlab.com/mike01/pypacker