ViewVC Help
View File | Revision Log | Show Annotations | Download File
/cvs/gvpe/src/connection.C
(Generate patch)

Comparing gvpe/src/connection.C (file contents):
Revision 1.103 by root, Thu Jul 18 17:35:10 2013 UTC vs.
Revision 1.112 by root, Fri Sep 12 10:40:43 2014 UTC

33 33
34#include <list> 34#include <list>
35#include <queue> 35#include <queue>
36#include <utility> 36#include <utility>
37 37
38#include <openssl/opensslv.h>
38#include <openssl/rand.h> 39#include <openssl/rand.h>
39#include <openssl/evp.h> 40#include <openssl/evp.h>
40#include <openssl/rsa.h> 41#include <openssl/rsa.h>
41#include <openssl/err.h> 42#include <openssl/err.h>
43
44// openssl 0.9.8 compatibility
45#if OPENSSL_VERSION_NUMBER < 0x10100000
46 #define require101(exp) exp
47#else
48 #define require101(exp) require (exp)
49#endif
42 50
43#include "conf.h" 51#include "conf.h"
44#include "slog.h" 52#include "slog.h"
45#include "device.h" 53#include "device.h"
46#include "vpn.h" 54#include "vpn.h"
48#include "hkdf.h" 56#include "hkdf.h"
49 57
50#include "netcompat.h" 58#include "netcompat.h"
51 59
52#define MAGIC "gvpe\xbd\xc6\xdb\x82" // 8 bytes of magic 60#define MAGIC "gvpe\xbd\xc6\xdb\x82" // 8 bytes of magic
53#define MAGIC "HUHN\xbd\xc6\xdb\x82" // 8 bytes of magic//D
54 61
55#define ULTRA_FAST 1 62#define ULTRA_FAST 1
56#define HLOG 15 63#define HLOG 15
57#include "lzf/lzf.h" 64#include "lzf/lzf.h"
58#include "lzf/lzf_c.c" 65#include "lzf/lzf_c.c"
126 kdf.extract (s, sizeof (s)); 133 kdf.extract (s, sizeof (s));
127 kdf.extract_done (HKDF_PRF_HASH ()); 134 kdf.extract_done (HKDF_PRF_HASH ());
128 kdf.expand (mac_key, sizeof (mac_key), mac_info, sizeof (mac_info)); 135 kdf.expand (mac_key, sizeof (mac_key), mac_info, sizeof (mac_info));
129 136
130 HMAC_CTX_init (&hctx); 137 HMAC_CTX_init (&hctx);
131 require (HMAC_Init_ex (&hctx, mac_key, MAC_KEYSIZE, MAC_DIGEST (), 0)); 138 require101 (HMAC_Init_ex (&hctx, mac_key, MAC_KEYSIZE, MAC_DIGEST (), 0));
132 } 139 }
133 140
134 { 141 {
135 u8 cipher_key[CIPHER_KEYSIZE]; 142 u8 cipher_key[CIPHER_KEYSIZE];
136 static const unsigned char cipher_info[] = "gvpe cipher key"; 143 static const unsigned char cipher_info[] = "gvpe cipher key";
178 185
179 return 1; 186 return 1;
180} 187}
181 188
182static void 189static void
183auth_hash (const auth_data &auth, auth_mac &mac) 190auth_hash (const auth_data &auth, const ecdh_key &b, auth_mac &mac)
184{ 191{
185 HMAC_CTX ctx; 192 hkdf kdf (b, sizeof b, AUTH_DIGEST ()); // use response ecdh b as salt
186 193 kdf.extract (&auth.rsa, sizeof (auth.rsa));
187 HMAC_CTX_init (&ctx); 194 kdf.extract_done ();
188 require (HMAC_Init_ex (&ctx, auth.rsa.auth_key, sizeof (auth.rsa.auth_key), AUTH_DIGEST (), 0)); 195 kdf.expand (mac, sizeof mac, auth.ecdh, sizeof (auth.ecdh)); // use challenge ecdh b as info
189 require (HMAC_Update (&ctx, (const unsigned char *)&auth, sizeof auth));
190 require (HMAC_Final (&ctx, (unsigned char *)&mac, 0));
191 HMAC_CTX_cleanup (&ctx);
192} 196}
193 197
194void 198void
195connection::generate_auth_data () 199connection::generate_auth_data ()
196{ 200{
197 if (auth_expire < ev_now ()) 201 if (auth_expire < ev_now ())
198 { 202 {
199 // request data 203 // request data
200 rand_fill (snd_auth.rsa); 204 rand_fill (snd_auth.rsa);
201 curve25519_generate (snd_ecdh_a, snd_auth.ecdh); 205 curve25519_generate (snd_ecdh_a, snd_auth.ecdh);
202 auth_hash (snd_auth, snd_auth_mac);
203 206
204 // eventual response data 207 // eventual response data
205 curve25519_generate (rcv_ecdh_a, rcv_ecdh_b); 208 curve25519_generate (rcv_ecdh_a, rcv_ecdh_b);
206 } 209 }
207 210
363 } 366 }
364} 367}
365 368
366///////////////////////////////////////////////////////////////////////////// 369/////////////////////////////////////////////////////////////////////////////
367 370
368unsigned char hmac_packet::hmac_digest[EVP_MAX_MD_SIZE];
369
370void 371void
371hmac_packet::hmac_gen (crypto_ctx *ctx) 372hmac_packet::hmac_gen (crypto_ctx *ctx, u8 *hmac_digest)
372{ 373{
373 unsigned int xlen;
374
375 HMAC_CTX *hctx = &ctx->hctx; 374 HMAC_CTX *hctx = &ctx->hctx;
376 375
377 require (HMAC_Init_ex (hctx, 0, 0, 0, 0)); 376 require101 (HMAC_Init_ex (hctx, 0, 0, 0, 0));
378 require (HMAC_Update (hctx, ((unsigned char *) this) + sizeof (hmac_packet), 377 require101 (HMAC_Update (hctx, ((unsigned char *) this) + sizeof (hmac_packet), len - sizeof (hmac_packet)));
379 len - sizeof (hmac_packet)));
380 require (HMAC_Final (hctx, (unsigned char *) &hmac_digest, &xlen)); 378 require101 (HMAC_Final (hctx, hmac_digest, 0));
381} 379}
382 380
383void 381void
384hmac_packet::hmac_set (crypto_ctx *ctx) 382hmac_packet::hmac_set (crypto_ctx *ctx)
385{ 383{
386 hmac_gen (ctx); 384 unsigned char hmac_digest[EVP_MAX_MD_SIZE];
387 385 hmac_gen (ctx, hmac_digest);
388 memcpy (hmac, hmac_digest, HMACLENGTH); 386 memcpy (hmac, hmac_digest, HMACLENGTH);
389} 387}
390 388
391bool 389bool
392hmac_packet::hmac_chk (crypto_ctx *ctx) 390hmac_packet::hmac_chk (crypto_ctx *ctx)
393{ 391{
394 hmac_gen (ctx); 392 unsigned char hmac_digest[EVP_MAX_MD_SIZE];
395 393 hmac_gen (ctx, hmac_digest);
396 return !memcmp (hmac, hmac_digest, HMACLENGTH); 394 return slow_memeq (hmac, hmac_digest, HMACLENGTH);
397} 395}
398 396
399void 397void
400vpn_packet::set_hdr (ptype type_, unsigned int dst) 398vpn_packet::set_hdr (ptype type_, unsigned int dst)
401{ 399{
702 si = rsi; 700 si = rsi;
703 protocol = rsi.prot; 701 protocol = rsi.prot;
704 702
705 slog (L_INFO, _("%s(%s): connection established (%s), protocol version %d.%d."), 703 slog (L_INFO, _("%s(%s): connection established (%s), protocol version %d.%d."),
706 conf->nodename, (const char *)rsi, 704 conf->nodename, (const char *)rsi,
707 is_direct ? "direct" : "forwarded", 705 vpn->can_direct (THISNODE, conf) ? "direct" : "forwarded",
708 PROTOCOL_MAJOR, prot_minor); 706 PROTOCOL_MAJOR, prot_minor);
709 707
710 if (::conf.script_node_up) 708 if (::conf.script_node_up)
711 { 709 {
712 run_script_cb *cb = new run_script_cb; 710 run_script_cb *cb = new run_script_cb;
724 722
725 // make sure rekeying timeouts are slightly asymmetric 723 // make sure rekeying timeouts are slightly asymmetric
726 ev::tstamp rekey_interval = ::conf.rekey + (conf->id > THISNODE->id ? 10 : 0); 724 ev::tstamp rekey_interval = ::conf.rekey + (conf->id > THISNODE->id ? 10 : 0);
727 rekey.start (rekey_interval, rekey_interval); 725 rekey.start (rekey_interval, rekey_interval);
728 726
727 hmac_error = 0.;
728
729 keepalive.start (::conf.keepalive); 729 keepalive.start (::conf.keepalive);
730 730
731 // send queued packets 731 // send queued packets
732 if (ictx && octx)
733 {
734 while (tap_packet *p = (tap_packet *)data_queue.get ()) 732 while (tap_packet *p = (tap_packet *)data_queue.get ())
735 { 733 {
736 if (p->len) send_data_packet (p); 734 if (p->len) send_data_packet (p);
737 delete p; 735 delete p;
738 } 736 }
739 737
740 while (vpn_packet *p = (vpn_packet *)vpn_queue.get ()) 738 while (vpn_packet *p = (vpn_packet *)vpn_queue.get ())
741 { 739 {
742 if (p->len) send_vpn_packet (p, si, IPTOS_RELIABILITY); 740 if (p->len) send_vpn_packet (p, si, IPTOS_RELIABILITY);
743 delete p; 741 delete p;
744 }
745 } 742 }
746 743
747 vpn->connection_established (this); 744 vpn->connection_established (this);
748} 745}
749 746
757 slog (L_TRACE, _("%s: direct connection denied by config."), conf->nodename); 754 slog (L_TRACE, _("%s: direct connection denied by config."), conf->nodename);
758 protocol = 0; 755 protocol = 0;
759 } 756 }
760 757
761 si.set (conf, protocol); 758 si.set (conf, protocol);
762
763 is_direct = si.valid ();
764} 759}
765 760
766// ensure sockinfo is valid, forward if necessary 761// ensure sockinfo is valid, forward if necessary
767const sockinfo & 762const sockinfo &
768connection::forward_si (const sockinfo &si) const 763connection::forward_si (const sockinfo &si) const
787 782
788void 783void
789connection::send_vpn_packet (vpn_packet *pkt, const sockinfo &si, int tos) 784connection::send_vpn_packet (vpn_packet *pkt, const sockinfo &si, int tos)
790{ 785{
791 if (!vpn->send_vpn_packet (pkt, si, tos)) 786 if (!vpn->send_vpn_packet (pkt, si, tos))
792 reset_connection (); 787 reset_connection ("packet send error");
793} 788}
794 789
795void 790void
796connection::send_ping (const sockinfo &si, u8 pong) 791connection::send_ping (const sockinfo &si, u8 pong)
797{ 792{
836void 831void
837connection::send_auth_response (const sockinfo &si) 832connection::send_auth_response (const sockinfo &si)
838{ 833{
839 auth_res_packet *pkt = new auth_res_packet (conf->id); 834 auth_res_packet *pkt = new auth_res_packet (conf->id);
840 835
841 auth_hash (rcv_auth, pkt->response.mac);
842 memcpy (pkt->response.ecdh, rcv_ecdh_b, sizeof (rcv_ecdh_b)); 836 memcpy (pkt->response.ecdh, rcv_ecdh_b, sizeof rcv_ecdh_b);
837 auth_hash (rcv_auth, rcv_ecdh_b, pkt->response.mac);
843 838
844 slog (L_TRACE, "%s << PT_AUTH_RES [%s]", conf->nodename, (const char *)si); 839 slog (L_TRACE, "%s << PT_AUTH_RES [%s]", conf->nodename, (const char *)si);
845 send_vpn_packet (pkt, si, IPTOS_RELIABILITY); // rsa is very very costly 840 send_vpn_packet (pkt, si, IPTOS_RELIABILITY); // rsa is very very costly
846 841
847 delete pkt; 842 delete pkt;
873 { 868 {
874 // a bit hacky, if ondemand, and packets are no longer queued, then reset the connection 869 // a bit hacky, if ondemand, and packets are no longer queued, then reset the connection
875 // and stop trying. should probably be handled by a per-connection expire handler. 870 // and stop trying. should probably be handled by a per-connection expire handler.
876 if (connectmode == conf_node::C_ONDEMAND && vpn_queue.empty () && data_queue.empty ()) 871 if (connectmode == conf_node::C_ONDEMAND && vpn_queue.empty () && data_queue.empty ())
877 { 872 {
878 reset_connection (); 873 reset_connection ("no demand");
879 return; 874 return;
880 } 875 }
881 876
882 last_establish_attempt = ev_now (); 877 last_establish_attempt = ev_now ();
883 878
885 ? (retry_cnt & 3) + 1 880 ? (retry_cnt & 3) + 1
886 : 1 << (retry_cnt >> 2)); 881 : 1 << (retry_cnt >> 2));
887 882
888 reset_si (); 883 reset_si ();
889 884
890 bool slow = si.prot & PROT_SLOW; 885 bool slow = (si.prot & PROT_SLOW) || (conf->low_power || THISNODE->low_power);
891 886
892 if (si.prot && !si.host && vpn->can_direct (THISNODE, conf)) 887 if (si.prot && !si.host && vpn->can_direct (THISNODE, conf))
893 { 888 {
894 /*TODO*/ /* start the timer so we don't recurse endlessly */ 889 /*TODO*/ /* start the timer so we don't recurse endlessly */
895 w.start (1); 890 w.start (1);
905 900
906 slow = slow || (dsi.prot & PROT_SLOW); 901 slow = slow || (dsi.prot & PROT_SLOW);
907 902
908 if (dsi.valid () && auth_rate_limiter.can (dsi)) 903 if (dsi.valid () && auth_rate_limiter.can (dsi))
909 { 904 {
910 if (retry_cnt < 4) 905 // use ping after the first few retries
906 // TODO: on rekeys, the other node might not interpret ping correctly,
907 // TODO: as it will still have a valid connection
908 if (retry_cnt < 4 && (!conf->low_power || THISNODE->low_power))
911 send_auth_request (dsi, true); 909 send_auth_request (dsi, true);
912 else 910 else
913 send_ping (dsi, 0); 911 send_ping (dsi, 0);
914 } 912 }
915 } 913 }
916 914
917 retry_int *= slow ? 8. : 0.9; 915 retry_int *= slow ? 4. : 0.9;
918 916
919 if (retry_int < conf->max_retry) 917 if (retry_int < conf->max_retry)
920 retry_cnt++; 918 retry_cnt++;
921 else 919 else
922 retry_int = conf->max_retry; 920 retry_int = conf->max_retry;
924 w.start (retry_int); 922 w.start (retry_int);
925 } 923 }
926} 924}
927 925
928void 926void
929connection::reset_connection () 927connection::reset_connection (const char *reason)
930{ 928{
931 if (ictx && octx) 929 if (ictx && octx)
932 { 930 {
933 slog (L_INFO, _("%s(%s): connection lost"), 931 slog (L_INFO, _("%s(%s): connection lost (%s)"),
934 conf->nodename, (const char *)si); 932 conf->nodename, (const char *)si, reason);
935 933
936 if (::conf.script_node_down) 934 if (::conf.script_node_down)
937 { 935 {
938 run_script_cb *cb = new run_script_cb; 936 run_script_cb *cb = new run_script_cb;
939 cb->set<connection, &connection::script_node_down> (this); 937 cb->set<connection, &connection::script_node_down> (this);
963connection::shutdown () 961connection::shutdown ()
964{ 962{
965 if (ictx && octx) 963 if (ictx && octx)
966 send_reset (si); 964 send_reset (si);
967 965
968 reset_connection (); 966 reset_connection ("shutdown");
969} 967}
970 968
971// poor-man's rekeying 969// poor-man's rekeying
972inline void 970inline void
973connection::rekey_cb (ev::timer &w, int revents) 971connection::rekey_cb (ev::timer &w, int revents)
974{ 972{
975 reset_connection (); 973 reset_connection ("rekeying");
976 establish_connection (); 974 establish_connection ();
977} 975}
978 976
979void 977void
980connection::send_data_packet (tap_packet *pkt) 978connection::send_data_packet (tap_packet *pkt)
997 995
998void 996void
999connection::post_inject_queue () 997connection::post_inject_queue ()
1000{ 998{
1001 // force a connection every now and when when packets are sent (max 1/s) 999 // force a connection every now and when when packets are sent (max 1/s)
1002 if (ev_now () - last_establish_attempt >= 0.95) // arbitrary 1000 if (ev_now () - last_establish_attempt >= (conf->low_power || THISNODE->low_power ? 2.95 : 0.95)) // arbitrary
1003 establish_connection.stop (); 1001 establish_connection.stop ();
1004 1002
1005 establish_connection (); 1003 establish_connection ();
1006} 1004}
1007 1005
1067 // about our desire for communication. 1065 // about our desire for communication.
1068 establish_connection (); 1066 establish_connection ();
1069 break; 1067 break;
1070 1068
1071 case vpn_packet::PT_RESET: 1069 case vpn_packet::PT_RESET:
1070 slog (L_TRACE, "%s >> PT_RESET", conf->nodename);
1071
1072 if (ictx && octx)
1072 { 1073 {
1073 reset_connection (); 1074 reset_connection ("remote reset");
1074 1075
1075 config_packet *p = (config_packet *) pkt; 1076 config_packet *p = (config_packet *) pkt;
1076 1077
1077 if (p->chk_config (conf, rsi) && connectmode == conf_node::C_ALWAYS) 1078 if (p->chk_config (conf, rsi) && connectmode == conf_node::C_ALWAYS)
1078 establish_connection (); 1079 establish_connection ();
1079 } 1080 }
1081
1080 break; 1082 break;
1081 1083
1082 case vpn_packet::PT_AUTH_REQ: 1084 case vpn_packet::PT_AUTH_REQ:
1083 if (auth_rate_limiter.can (rsi)) 1085 if (auth_rate_limiter.can (rsi))
1084 { 1086 {
1099 slog (L_INFO, _("%s(%s): protocol minor version mismatch: ours is %d, %s's is %d."), 1101 slog (L_INFO, _("%s(%s): protocol minor version mismatch: ours is %d, %s's is %d."),
1100 conf->nodename, (const char *)rsi, 1102 conf->nodename, (const char *)rsi,
1101 PROTOCOL_MINOR, conf->nodename, p->prot_minor); 1103 PROTOCOL_MINOR, conf->nodename, p->prot_minor);
1102 1104
1103 if (p->initiate) 1105 if (p->initiate)
1106 {
1104 send_auth_request (rsi, false); 1107 send_auth_request (rsi, false);
1108
1109 if (ictx && octx)
1110 reset_connection ("reconnect");
1111 }
1105 1112
1106 auth_data auth; 1113 auth_data auth;
1107 1114
1108 if (!auth_decrypt (::conf.rsa_key, p->encr, auth)) 1115 if (!auth_decrypt (::conf.rsa_key, p->encr, auth))
1109 { 1116 {
1110 slog (L_ERR, _("%s(%s): challenge illegal or corrupted (%s). mismatched key or config file?"), 1117 slog (L_ERR, _("%s(%s): challenge illegal or corrupted (%s). mismatched key or config file?"),
1111 conf->nodename, (const char *)rsi, ERR_error_string (ERR_get_error (), 0)); 1118 conf->nodename, (const char *)rsi, ERR_error_string (ERR_get_error (), 0));
1112 } 1119 }
1113 else 1120 else
1114 { 1121 {
1115 bool chg = !have_rcv_auth || memcmp (&rcv_auth, &auth, sizeof auth); 1122 bool chg = !have_rcv_auth || !slow_memeq (&rcv_auth, &auth, sizeof auth);
1116 1123
1117 rcv_auth = auth; 1124 rcv_auth = auth;
1118 have_rcv_auth = true; 1125 have_rcv_auth = true;
1119 1126
1120 send_auth_response (rsi); 1127 send_auth_response (rsi);
1140 { 1147 {
1141 auth_res_packet *p = (auth_res_packet *)pkt; 1148 auth_res_packet *p = (auth_res_packet *)pkt;
1142 1149
1143 slog (L_TRACE, "%s >> PT_AUTH_RES", conf->nodename); 1150 slog (L_TRACE, "%s >> PT_AUTH_RES", conf->nodename);
1144 1151
1152 auth_mac local_mac;
1153 auth_hash (snd_auth, p->response.ecdh, local_mac);
1154
1145 if (memcmp (&p->response.mac, snd_auth_mac, sizeof (snd_auth_mac))) 1155 if (!slow_memeq (&p->response.mac, local_mac, sizeof local_mac))
1146 { 1156 {
1147 slog (L_ERR, _("%s(%s): unrequested or outdated auth response, ignoring."), 1157 slog (L_ERR, _("%s(%s): unrequested or outdated auth response, ignoring."),
1148 conf->nodename, (const char *)rsi); 1158 conf->nodename, (const char *)rsi);
1149 } 1159 }
1150 else if (!have_snd_auth) 1160 else if (!have_snd_auth)
1151 { 1161 {
1152 memcpy (snd_ecdh_b, p->response.ecdh, sizeof (snd_ecdh_b)); 1162 memcpy (snd_ecdh_b, p->response.ecdh, sizeof snd_ecdh_b);
1153 1163
1154 have_snd_auth = true; 1164 have_snd_auth = true;
1155 connection_established (rsi); 1165 connection_established (rsi);
1156 } 1166 }
1157
1158 break;
1159 } 1167 }
1160
1161 send_reset (rsi);
1162 break; 1168 break;
1163 1169
1164 case vpn_packet::PT_DATA_COMPRESSED: 1170 case vpn_packet::PT_DATA_COMPRESSED:
1165#if !ENABLE_COMPRESSION 1171#if !ENABLE_COMPRESSION
1166 send_reset (rsi); 1172 send_reset (rsi);
1172 if (ictx && octx) 1178 if (ictx && octx)
1173 { 1179 {
1174 vpndata_packet *p = (vpndata_packet *)pkt; 1180 vpndata_packet *p = (vpndata_packet *)pkt;
1175 1181
1176 if (!p->hmac_chk (ictx)) 1182 if (!p->hmac_chk (ictx))
1183 {
1184 // rekeying often creates temporary hmac auth floods
1185 // we assume they don't take longer than a few seconds normally,
1186 // and suppress messages and resets during that time.
1187 //TODO: should be done per source address
1188 if (!hmac_error)
1189 {
1190 hmac_error = ev_now () + 3;
1191 break;
1192 }
1193 else if (hmac_error >= ev_now ())
1194 break; // silently suppress
1195 else
1196 {
1177 slog (L_ERR, _("%s(%s): hmac authentication error, received invalid packet\n" 1197 slog (L_ERR, _("%s(%s): hmac authentication error, received invalid packet\n"
1178 "could be an attack, or just corruption or a synchronization error."), 1198 "could be an attack, or just corruption or a synchronization error."),
1179 conf->nodename, (const char *)rsi); 1199 conf->nodename, (const char *)rsi);
1200 // reset
1201 }
1202 }
1180 else 1203 else
1181 { 1204 {
1182 u32 seqno; 1205 u32 seqno;
1183 tap_packet *d = p->unpack (this, seqno); 1206 tap_packet *d = p->unpack (this, seqno);
1184 int seqclass = iseqno.seqno_classify (seqno); 1207 int seqclass = iseqno.seqno_classify (seqno);
1208
1209 hmac_error = 0;
1185 1210
1186 if (seqclass == 0) // ok 1211 if (seqclass == 0) // ok
1187 { 1212 {
1188 vpn->tap->send (d); 1213 vpn->tap->send (d);
1189 1214
1316 1341
1317 if (when >= 0) 1342 if (when >= 0)
1318 w.start (when); 1343 w.start (when);
1319 else if (when < -15) 1344 else if (when < -15)
1320 { 1345 {
1321 reset_connection (); 1346 reset_connection ("keepalive overdue");
1322 establish_connection (); 1347 establish_connection ();
1323 } 1348 }
1324 else if (conf->connectmode != conf_node::C_ONDEMAND 1349 else if (conf->connectmode != conf_node::C_ONDEMAND
1325 || THISNODE->connectmode != conf_node::C_ONDEMAND) 1350 || THISNODE->connectmode != conf_node::C_ONDEMAND)
1326 { 1351 {
1330 else if (when >= -10) 1355 else if (when >= -10)
1331 // hold ondemand connections implicitly a few seconds longer 1356 // hold ondemand connections implicitly a few seconds longer
1332 // should delete octx, though, or something like that ;) 1357 // should delete octx, though, or something like that ;)
1333 w.start (when + 10); 1358 w.start (when + 10);
1334 else 1359 else
1335 reset_connection (); 1360 reset_connection ("keepalive timeout");
1336} 1361}
1337 1362
1338void 1363void
1339connection::send_connect_request (int id) 1364connection::send_connect_request (int id)
1340{ 1365{
1440 1465
1441 // queue a dummy packet to force an initial connection attempt 1466 // queue a dummy packet to force an initial connection attempt
1442 if (connectmode != conf_node::C_ALWAYS && connectmode != conf_node::C_DISABLED) 1467 if (connectmode != conf_node::C_ALWAYS && connectmode != conf_node::C_DISABLED)
1443 vpn_queue.put (new net_packet); 1468 vpn_queue.put (new net_packet);
1444 1469
1445 reset_connection (); 1470 reset_connection ("startup");
1446} 1471}
1447 1472
1448connection::~connection () 1473connection::~connection ()
1449{ 1474{
1450 shutdown (); 1475 shutdown ();

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines