Let choose_local_address() prefer addresses discovered via SLPD

This commit is contained in:
thorkill 2016-05-25 18:25:28 +02:00
parent 11b8eb81b9
commit 69bb848f59

View file

@ -605,6 +605,8 @@ static void choose_local_address(const node_t *n, const sockaddr_t **sa, int *so
int j = rand() % n->edge_tree->count;
edge_t *candidate = NULL;
if (!n->slpd_address) {
for splay_each(edge_t, e, n->edge_tree) {
if(i++ == j) {
candidate = e;
@ -617,6 +619,9 @@ static void choose_local_address(const node_t *n, const sockaddr_t **sa, int *so
*sock = rand() % listen_sockets;
adapt_socket(*sa, sock);
}
} else {
//*sa = str2sockaddr
}
}
static void send_udppacket(node_t *n, vpn_packet_t *origpkt) {