Client-side handling of OCC_SERVER_EXIT
PATCH 1/1 Client-side handling of OCC_SERVER_EXIT
When client receives OCC_SERVER_EXIT, it fires SIGUSR1 and switches to the next server. Next server is defined as same remote with different IP address if remote resolves into multiple addresses or next remote otherwise.
This is a client-side only verion of "Notify clients about server's exit/restart" patch.
--- src/openvpn/occ.c | 7 +++++++ src/openvpn/occ.h | 5 +++++ 2 files changed, 12 insertions(+)
src/openvpn/occ.c +7 -0
@@ -390,6 +390,13 @@ process_received_occ_msg (struct context *c) c->sig->signal_received =SIGTERM ; c->sig->signal_text ="remote-exit" ;break ; + +case OCC_SERVER_EXIT : +msg (D_LOW ,"RECEIVED OCC_SERVER_EXIT" ); + c->sig->signal_received =SIGUSR1 ; + c->sig->signal_text ="remote-server-exit" ; + c->options.no_advance = false; +break ; } c->c2.buf.len =0 ;/* don't pass packet on */ }
src/openvpn/occ.h +5 -0
@@ -70,6 +70,11 @@#define OCC_EXIT 6/* +* Notifies clients that server is exiting/restarting +*/ +#define OCC_SERVER_EXIT 7 + +/* * Used to conduct a load test command sequence * of UDP connection for empirical MTU measurement. */
Signature · 1 line
1.9.1