diff options
author | Arne Schwabe <arne@rfc2549.org> | 2012-12-25 16:04:16 +0100 |
---|---|---|
committer | Arne Schwabe <arne@rfc2549.org> | 2012-12-25 16:04:16 +0100 |
commit | ec7e164908aef22642da6980fc2aad5bebb31882 (patch) | |
tree | a7932bf7d816275b92c112e70abce46703463ca6 /openvpn/src | |
parent | 923426e5e617c0ca7d5f61798b409c455528a8a4 (diff) |
OpenVPN fixes
Diffstat (limited to 'openvpn/src')
-rw-r--r-- | openvpn/src/openvpn/init.c | 33 | ||||
-rw-r--r-- | openvpn/src/openvpn/openvpn.h | 1 | ||||
-rw-r--r-- | openvpn/src/openvpn/options.h | 1 | ||||
-rw-r--r-- | openvpn/src/openvpn/push.c | 8 |
4 files changed, 26 insertions, 17 deletions
diff --git a/openvpn/src/openvpn/init.c b/openvpn/src/openvpn/init.c index e2942c0..b312528 100644 --- a/openvpn/src/openvpn/init.c +++ b/openvpn/src/openvpn/init.c @@ -341,24 +341,29 @@ next_connection_entry (struct context *c) } else { + /* FIXME (schwabe) fix the persist-remote-ip option for real, + * this is broken probably ever since connection lists and multiple + * remote existed + */ + + if (!c->options.persist_remote_ip) + clear_remote_addrlist (&c->c1.link_socket_addr); + else + c->c1.link_socket_addr.current_remote = + c->c1.link_socket_addr.remote_list; + + /* + * Increase the number of connection attempts + * If this is connect-retry-max * size(l) + * OpenVPN will quit + */ + c->options.unsuccessful_attempts++; + if (++l->current >= l->len) { - /* FIXME (schwabe) fix the persist-remote-ip option for real, - * this is broken probably ever since connection lists and multiple - * remote existed - */ - /* - * Increase the number of connection attempts - * If this is connect-retry-max * size(l) - * OpenVPN will quit - */ - - if (!c->options.persist_remote_ip) - clear_remote_addrlist (&c->c1.link_socket_addr); - + l->current = 0; - ++l->n_cycles; if (++n_cycles >= 2) msg (M_FATAL, "No usable connection profiles are present"); } diff --git a/openvpn/src/openvpn/openvpn.h b/openvpn/src/openvpn/openvpn.h index 7abfb08..bdfa685 100644 --- a/openvpn/src/openvpn/openvpn.h +++ b/openvpn/src/openvpn/openvpn.h @@ -474,6 +474,7 @@ struct context_2 bool did_pre_pull_restore; /* hash of pulled options, so we can compare when options change */ + bool pulled_options_md5_init_done; struct md5_state pulled_options_state; struct md5_digest pulled_options_digest; diff --git a/openvpn/src/openvpn/options.h b/openvpn/src/openvpn/options.h index 9138784..909cb38 100644 --- a/openvpn/src/openvpn/options.h +++ b/openvpn/src/openvpn/options.h @@ -153,7 +153,6 @@ struct connection_list { int len; int current; - int n_cycles; struct connection_entry *array[CONNECTION_LIST_SIZE]; }; diff --git a/openvpn/src/openvpn/push.c b/openvpn/src/openvpn/push.c index 148d7eb..994b7ba 100644 --- a/openvpn/src/openvpn/push.c +++ b/openvpn/src/openvpn/push.c @@ -446,10 +446,14 @@ process_incoming_push_msg (struct context *c, if (ch == ',') { struct buffer buf_orig = buf; + if (!c->c2.pulled_options_md5_init_done) + { + md5_state_init (&c->c2.pulled_options_state); + c->c2.pulled_options_md5_init_done = true; + } if (!c->c2.did_pre_pull_restore) { pre_pull_restore (&c->options); - md5_state_init (&c->c2.pulled_options_state); c->c2.did_pre_pull_restore = true; } if (apply_push_options (&c->options, @@ -463,8 +467,8 @@ process_incoming_push_msg (struct context *c, case 1: md5_state_update (&c->c2.pulled_options_state, BPTR(&buf_orig), BLEN(&buf_orig)); md5_state_final (&c->c2.pulled_options_state, &c->c2.pulled_options_digest); + c->c2.pulled_options_md5_init_done = false; ret = PUSH_MSG_REPLY; - md5_state_init (&c->c2.pulled_options_state); break; case 2: md5_state_update (&c->c2.pulled_options_state, BPTR(&buf_orig), BLEN(&buf_orig)); |