Commit 826405a2 authored by Lorenzo Colitti's avatar Lorenzo Colitti
Browse files

Add more randomness to TCP connections.

Previously we used a fixed sequence number and a fixed remote IP
address. This makes TCPAcceptTest fail a low percentage of the
time because if we re-use the same remote port on two different
incoming connections, the second one is likely to hit the
previous socket which is now in TIME-WAIT state. This will either
silently drop the SYN or send an ack with the previous sequence
number.

Make the sequence number random (there's no reason it shouldn't
be) and use GetRandomDestination to put 13-16 bits of entropy in
the remote address.

Test: all_tests.sh passes on android-3.18.
Bug: 31119353
Change-Id: Ie6aee2a48404eafdc3c33262eb252df4b89876c6
parent 85d31157
Loading
Loading
Loading
Loading
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please to comment