Re: inet_hash_connect: source port allocation
From: Eric Dumazet <hidden>
Date: 2010-11-29 18:46:08
From: Eric Dumazet <hidden>
Date: 2010-11-29 18:46:08
Le lundi 29 novembre 2010 à 18:29 +0000, John Haxby a écrit :
Sorry, I think I phrased my question badly.
inet_csk_get_port() starts its search for a free port with
smallest_rover = rover = net_random() % remaining + low;
whereas __inet_hash_connect() basically misses out that call to
net_random() so you get a predictable port number.
Is there any good reason why that is the case?It seems random select was done at bind() time only in commit 6df716340da3a6f ([TCP/DCCP]: Randomize port selection) It probably should be done in autobind too.