diff options
author | David Sommerseth <dazo@users.sourceforge.net> | 2010-02-18 21:20:14 +0100 |
---|---|---|
committer | David Sommerseth <dazo@users.sourceforge.net> | 2010-04-29 20:22:07 +0200 |
commit | f279a6b97bfd63d8e1d336745ad23638a670e6ce (patch) | |
tree | aeb24774897ada4edbf1456151ef7eb7acd5c53b | |
parent | Cleaning up after rebase (diff) | |
download | openvpn-f279a6b97bfd63d8e1d336745ad23638a670e6ce.tar.xz |
Do not randomize resolving of IP addresses in getaddr()
Based on a discussion on the mailing list and in the IRC meeting Feb 18,
it was decided to remove get_random() from the getaddr() function as that
can conflict with round-robin/randomization done by DNS servers.
This change must be documented in the release notes.
Signed-off-by: David Sommerseth <dazo@users.sourceforge.net>
Diffstat (limited to '')
-rw-r--r-- | socket.c | 5 |
1 files changed, 2 insertions, 3 deletions
@@ -212,12 +212,11 @@ getaddr (unsigned int flags, ++n; ASSERT (n >= 2); - msg (D_RESOLVE_ERRORS, "RESOLVE: NOTE: %s resolves to %d addresses, choosing one by random", + msg (D_RESOLVE_ERRORS, "RESOLVE: NOTE: %s resolves to %d addresses, choosing the first resolved IP address", hostname, n); - /* choose address randomly, for basic load-balancing capability */ - ia.s_addr = *(in_addr_t *) (h->h_addr_list[get_random () % n]); + ia.s_addr = *(in_addr_t *) (h->h_addr_list[0]); } } |