You are right, it definetely looked like an OS or
library bug, but that was too unlikely to me at the
moment.
Anyway, as it turns out to be, this is a by-design
behaviour of FreeBSD with system config
net.inet.ip.portrange.randomized turned on, so that port
numbers are picked at random. I can see the tradeoffs, but to
me this looks like a bug, because as a client I can't do
anything to prevent random numbers from matching. What
difference does it make if it's happening more frequently
under higher loads, there is still a chance that any particular
connection fails for no particular reason, like in:
if (rand() == rand()) fail();
I can switch net.inet.ip.portrange.randomized off, but then it
doesn't make switching it on sane at all. I'm somewhat
displeased with FreeBSD in this matter. Do you happen to know
if similar is true with Linux ?
Sincerely,
Dmitry Dvoinikov
http://www.targeted.org/
[...]
|