Sockets: IPPROTO_IP not supported

Peter Pearson pkpearson at nowhere.invalid
Mon Jan 16 00:47:58 EST 2017


Trying to sniff Ethernet packets, I do this:

    s = socket.socket(socket.AF_INET, socket.SOCK_RAW, socket.IPPROTO_IP)

but it results in this:

    $ sudo python3 sniff_survey.py 
    Traceback (most recent call last):
      File "sniff_survey.py", line 118, in <module>
        s = socket.socket(socket.AF_INET, socket.SOCK_RAW, socket.IPPROTO_IP)
      File "/usr/lib/python3.2/socket.py", line 94, in __init__
        _socket.socket.__init__(self, family, type, proto, fileno)
    socket.error: [Errno 93] Protocol not supported

Anybody know what I'm doing wrong?  (Python 3.2.3 under Debian 3.2.84-1.)

-- 
To email me, substitute nowhere->runbox, invalid->com.



More information about the Python-list mailing list