phaethon/kamene

NameErrror in supersocket.py: can't use L2Socket

gregoiremenguy opened this issue · 3 comments

Hi,
I got a problem using L2Socket. Here is an example:

from scapy.all import *

l2=L2Socket("my_interface")
packet = Ether(src='myMAC') / IP(src='ip1', dst='ip2', proto=6) / TCP()
l2.sr1(packet)

This works using python2.7 but with python3.5 it returns:

a,b = sendrecv.sndrcv(self, *args, **kargs)
NameError: name 'sendrecv' is not defined

This error doesn't occur only for L2Socket.sr1() but also for L2Socket.sr() and L2Socket.sniff.

I fixed the problem on my computer replacing:

import scapy.sendrecv

at line 141 of supersocket.py, by:

import scapy.sendrecv as sendrecv

Excuse me if this issue is already known.

Thanks

Problems with sockets usually are platform specific. Are you Linux/Win/Mac? Is it Ethernet or WiFi interface?

I was on Linux end it was on an Ethernet interface.

end -> and !!!

Sorry