… | |
… | |
711 | void |
711 | void |
712 | connection::reset_si () |
712 | connection::reset_si () |
713 | { |
713 | { |
714 | protocol = best_protocol (THISNODE->protocols & conf->protocols); |
714 | protocol = best_protocol (THISNODE->protocols & conf->protocols); |
715 | |
715 | |
716 | // mask out protocols we cannot establish |
716 | // mask out endpoints we can't connect to |
717 | if (!conf->udp_port) protocol &= ~PROT_UDPv4; |
717 | if (!conf->udp_port) protocol &= ~PROT_UDPv4; |
718 | if (!conf->tcp_port) protocol &= ~PROT_TCPv4; |
718 | if (!conf->tcp_port) protocol &= ~PROT_TCPv4; |
719 | if (!conf->dns_port) protocol &= ~PROT_DNSv4; |
719 | if (!conf->dns_port) protocol &= ~PROT_DNSv4; |
720 | |
720 | |
721 | if (protocol |
721 | if (protocol |
… | |
… | |
742 | slog (L_DEBUG, _("%s: no common protocol, trying indirectly through %s (%s)"), |
742 | slog (L_DEBUG, _("%s: no common protocol, trying indirectly through %s (%s)"), |
743 | conf->nodename, r->conf->nodename, (const char *)r->si); |
743 | conf->nodename, r->conf->nodename, (const char *)r->si); |
744 | return r->si; |
744 | return r->si; |
745 | } |
745 | } |
746 | else |
746 | else |
747 | slog (L_DEBUG, _("%s: node unreachable, no common protocol"), |
747 | slog (L_DEBUG, _("%s: node unreachable, no common protocol, no router"), |
748 | conf->nodename); |
748 | conf->nodename); |
749 | } |
749 | } |
750 | |
750 | |
751 | return si; |
751 | return si; |
752 | } |
752 | } |
… | |
… | |
1368 | connection::connection (struct vpn *vpn, conf_node *conf) |
1368 | connection::connection (struct vpn *vpn, conf_node *conf) |
1369 | : vpn(vpn), conf(conf), |
1369 | : vpn(vpn), conf(conf), |
1370 | #if ENABLE_DNS |
1370 | #if ENABLE_DNS |
1371 | dns (0), |
1371 | dns (0), |
1372 | #endif |
1372 | #endif |
1373 | data_queue(conf->max_ttl, conf->max_queue), |
1373 | data_queue(conf->max_ttl, conf->max_queue + 1), |
1374 | vpn_queue(conf->max_ttl, conf->max_queue) |
1374 | vpn_queue(conf->max_ttl, conf->max_queue + 1) |
1375 | { |
1375 | { |
1376 | rekey .set<connection, &connection::rekey_cb > (this); |
1376 | rekey .set<connection, &connection::rekey_cb > (this); |
1377 | keepalive .set<connection, &connection::keepalive_cb > (this); |
1377 | keepalive .set<connection, &connection::keepalive_cb > (this); |
1378 | establish_connection.set<connection, &connection::establish_connection_cb> (this); |
1378 | establish_connection.set<connection, &connection::establish_connection_cb> (this); |
1379 | |
1379 | |