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(sock et.SOL_SOCKET,I N.SO_BINDTODEVI CE,"eth0")
setsockopt(sock et.SOL_SOCKET,I N.SO_BINDTODEVI CE,inet_aton("e th0"))
setsockopt(sock et.SOL_SOCKET,I N.SO_BINDTODEVI CE,struct.pack( "s","eth0") )
setsockopt(sock et.SOL_SOCKET,I N.SO_BINDTODEVI CE,struct.pack( "p","eth0") )
None of these work. I just get a "socket.err or: (19, 'No such device')".
I do have an "eth0" device :-)
Many thanks
Richard
Comment