Kai
Kai

Reputation: 2325

Send raw ethernet packet with data field length in type field

I'm trying to send a raw ethernet frame with the length of my data written in the type field. This should be a valid ethernet frame. My code for this looks like this:

ethData = "foobar"

proto =len(ethData)

if proto < 46:
  proto = 46

soc = socket.socket(socket.AF_PACKET, socket.SOCK_RAW, proto)
soc.bind((iface, proto))

For some reason I cant read package on the other end. I wonder why. I try to get this package in the interrupt handler of my wireless driver, so this packet has to be droped by my hardware directly or it doesn't get send at all. The question is why.

Upvotes: 2

Views: 1877

Answers (1)

Kai
Kai

Reputation: 2325

Sorry, my fault. I just parsed the wrong portion of the packet and didn't get any output. My bad. The package gets there just like it is supposed to.

Upvotes: 0

Related Questions