Re: Raw socket when interface down.

2008-11-05 Thread [EMAIL PROTECTED]
On Nov 5, 8:37 pm, Mat <[EMAIL PROTECTED]> wrote: > Hi, > > I'm trying to use raw sockets in python for a dhcp client. I write this code : > > soc = socket.socket(socket.PF_PACKET, socket.SOCK_RAW) > soc.bind(("eth0",0x0800)) > data = soc.recv(1024) > print len(data) > > It seems to work correctly

Raw socket when interface down.

2008-11-05 Thread Mat
Hi, I'm trying to use raw sockets in python for a dhcp client. I write this code : soc = socket.socket(socket.PF_PACKET, socket.SOCK_RAW) soc.bind(("eth0",0x0800)) data = soc.recv(1024) print len(data) It seems to work correctly when interface is up, but when network interface is down I get this