Always try next Address when an outgoing connection fails to authenticate.
authorGuus Sliepen <guus@tinc-vpn.org>
Tue, 20 Mar 2012 22:49:16 +0000 (23:49 +0100)
committerGuus Sliepen <guus@tinc-vpn.org>
Tue, 20 Mar 2012 22:49:16 +0000 (23:49 +0100)
commit80e15d8b96e5313b33c91003b1f75d7f6db9924e
tree45eab34a742b6305a52ebdb6fd9303dfbc8db2c9
parent28a1501b9a8b4c730f7f965d6b2e8fc50feba261
Always try next Address when an outgoing connection fails to authenticate.

When making outgoing connections, tinc goes through the list of Addresses and
tries all of them until one succeeds. However, before it would consider
establishing a TCP connection a success, even when the authentication failed.
This would be a problem if the first Address would point to a hostname and port
combination that belongs to the wrong tinc node, or perhaps even to a non-tinc
service, causing tinc to endlessly try this Address instead of moving to the
next one.

Problem found by Delf Eldkraft.
src/connection.c
src/connection.h
src/net.c
src/protocol_misc.c