[ntp:questions] ipv6 support on linux - bind problem

Wolfgang S. Rupprecht wolfgang.rupprecht+gnus200704 at gmail.com
Mon Apr 9 15:31:19 UTC 2007

Uwe Klein <uwe_klein_habertwedt at t-online.de> writes:
> does this look any different when you do a :
> 	setsockopt(sock, SOL_SOCKET, SO_REUSEADDR,.....
> before any binding to that local port?

That is a good question, but no it doesn't seem to help.

I always have those REUSEADDR lines in all my personal code and it
didn't help here.  REUSEADDR seems to only help when you restart the
daemon and the old socket still has connections in timed waits.  (I
suppose that means it only does anything for TCP, which is where I was
introduced to the problem.)

Thinking about it from a different angle, I don't see how the kernel
could ever allow two wildcard binds on the same address and port.  For
incoming packets, it would have no way to tell which of the two
sockets to send a packet to.  If subsequent packets when to different
ports then the reassembly of multi-packet messages would be impossible
without lots of retransmissions.  It would look like a 50% packet loss
rate, which is effectively unusable.

Wolfgang S. Rupprecht                http://www.wsrcc.com/wolfgang/

More information about the questions mailing list