… | |
… | |
463 | #if ENABLE_COMPRESSION |
463 | #if ENABLE_COMPRESSION |
464 | f |= FEATURE_COMPRESSION; |
464 | f |= FEATURE_COMPRESSION; |
465 | #endif |
465 | #endif |
466 | #if ENABLE_ROHC |
466 | #if ENABLE_ROHC |
467 | f |= FEATURE_ROHC; |
467 | f |= FEATURE_ROHC; |
|
|
468 | #endif |
|
|
469 | #if ENABLE_BRIDGING |
|
|
470 | f |= FEATURE_BRIDGING; |
468 | #endif |
471 | #endif |
469 | return f; |
472 | return f; |
470 | } |
473 | } |
471 | }; |
474 | }; |
472 | |
475 | |
… | |
… | |
623 | // mask out protocols we cannot establish |
626 | // mask out protocols we cannot establish |
624 | if (!conf->udp_port) protocol &= ~PROT_UDPv4; |
627 | if (!conf->udp_port) protocol &= ~PROT_UDPv4; |
625 | if (!conf->tcp_port) protocol &= ~PROT_TCPv4; |
628 | if (!conf->tcp_port) protocol &= ~PROT_TCPv4; |
626 | if (!conf->dns_port) protocol &= ~PROT_DNSv4; |
629 | if (!conf->dns_port) protocol &= ~PROT_DNSv4; |
627 | |
630 | |
|
|
631 | if (protocol |
|
|
632 | && (!conf->can_direct (THISNODE) |
|
|
633 | || !THISNODE->can_direct (conf))) |
|
|
634 | { |
|
|
635 | slog (L_DEBUG, _("%s: direct connection denied"), conf->nodename); |
|
|
636 | protocol = 0; |
|
|
637 | } |
|
|
638 | |
628 | si.set (conf, protocol); |
639 | si.set (conf, protocol); |
629 | } |
640 | } |
630 | |
641 | |
631 | // ensure sockinfo is valid, forward if necessary |
642 | // ensure sockinfo is valid, forward if necessary |
632 | const sockinfo & |
643 | const sockinfo & |
… | |
… | |
717 | } |
728 | } |
718 | |
729 | |
719 | void |
730 | void |
720 | connection::send_connect_info (int rid, const sockinfo &rsi, u8 rprotocols) |
731 | connection::send_connect_info (int rid, const sockinfo &rsi, u8 rprotocols) |
721 | { |
732 | { |
722 | slog (L_TRACE, ">>%d PT_CONNECT_INFO(%d,%s)\n", |
733 | slog (L_TRACE, ">>%d PT_CONNECT_INFO(%d,%s)", |
723 | conf->id, rid, (const char *)rsi); |
734 | conf->id, rid, (const char *)rsi); |
724 | |
735 | |
725 | connect_info_packet *r = new connect_info_packet (conf->id, rid, rsi, rprotocols); |
736 | connect_info_packet *r = new connect_info_packet (conf->id, rid, rsi, rprotocols); |
726 | |
737 | |
727 | r->hmac_set (octx); |
738 | r->hmac_set (octx); |
… | |
… | |
1087 | if (p->id > 0 && p->id <= vpn->conns.size ()) |
1098 | if (p->id > 0 && p->id <= vpn->conns.size ()) |
1088 | { |
1099 | { |
1089 | connection *c = vpn->conns[p->id - 1]; |
1100 | connection *c = vpn->conns[p->id - 1]; |
1090 | conf->protocols = p->protocols; |
1101 | conf->protocols = p->protocols; |
1091 | |
1102 | |
1092 | slog (L_TRACE, "<<%d PT_CONNECT_REQ(%d) [%d]\n", |
1103 | slog (L_TRACE, "<<%d PT_CONNECT_REQ(%d) [%d]", |
1093 | conf->id, p->id, c->ictx && c->octx); |
1104 | conf->id, p->id, c->ictx && c->octx); |
1094 | |
1105 | |
1095 | if (c->ictx && c->octx) |
1106 | if (c->ictx && c->octx) |
1096 | { |
1107 | { |
1097 | // send connect_info packets to both sides, in case one is |
1108 | // send connect_info packets to both sides, in case one is |