R
Richard Taylor
Hi
Does anyone know the correct way to pass the 'device' argument to setsockopt
with the SO_BINDTODEVICE flag?
I have tried various methods:
setsockopt(socket.SOL_SOCKET,IN.SO_BINDTODEVICE,"eth0")
setsockopt(socket.SOL_SOCKET,IN.SO_BINDTODEVICE,inet_aton("eth0"))
setsockopt(socket.SOL_SOCKET,IN.SO_BINDTODEVICE,struct.pack("s","eth0"))
setsockopt(socket.SOL_SOCKET,IN.SO_BINDTODEVICE,struct.pack("p","eth0"))
None of these work. I just get a "socket.error: (19, 'No such device')".
I do have an "eth0" device
Many thanks
Richard
Does anyone know the correct way to pass the 'device' argument to setsockopt
with the SO_BINDTODEVICE flag?
I have tried various methods:
setsockopt(socket.SOL_SOCKET,IN.SO_BINDTODEVICE,"eth0")
setsockopt(socket.SOL_SOCKET,IN.SO_BINDTODEVICE,inet_aton("eth0"))
setsockopt(socket.SOL_SOCKET,IN.SO_BINDTODEVICE,struct.pack("s","eth0"))
setsockopt(socket.SOL_SOCKET,IN.SO_BINDTODEVICE,struct.pack("p","eth0"))
None of these work. I just get a "socket.error: (19, 'No such device')".
I do have an "eth0" device
Many thanks
Richard