aboutsummaryrefslogtreecommitdiff
path: root/forward.c
diff options
context:
space:
mode:
authorjames <james@e7ae566f-a301-0410-adde-c780ea21d3b5>2009-10-01 21:08:40 +0000
committerjames <james@e7ae566f-a301-0410-adde-c780ea21d3b5>2009-10-01 21:08:40 +0000
commitf25071b66fbcf508f46e16f30e964bdaa8f97d6f (patch)
treee631bf4ca86a57183e9cdb8e13a64a694ccc0555 /forward.c
parentMinor fix: management interface shouldn't echo 'load-stats' commands to (diff)
downloadopenvpn-f25071b66fbcf508f46e16f30e964bdaa8f97d6f.tar.xz
client-kill management interface command, when issued on server, will
now send a RESTART message to client. This feature is intended to make UDP clients respond the same as TCP clients in the case where the server issues a RESTART message in order to force the client to reconnect and pull a new options/route list. git-svn-id: http://svn.openvpn.net/projects/openvpn/branches/BETA21/openvpn@5021 e7ae566f-a301-0410-adde-c780ea21d3b5
Diffstat (limited to '')
-rw-r--r--forward.c11
1 files changed, 7 insertions, 4 deletions
diff --git a/forward.c b/forward.c
index 87f3350..661ac5c 100644
--- a/forward.c
+++ b/forward.c
@@ -157,6 +157,8 @@ check_incoming_control_channel_dowork (struct context *c)
receive_auth_failed (c, &buf);
else if (buf_string_match_head_str (&buf, "PUSH_"))
incoming_push_message (c, &buf);
+ else if (buf_string_match_head_str (&buf, "RESTART"))
+ server_pushed_restart (c, &buf);
else
msg (D_PUSH_ERRORS, "WARNING: Received unknown control message: %s", BSTR (&buf));
}
@@ -181,7 +183,7 @@ check_push_request_dowork (struct context *c)
event_timeout_modify_wakeup (&c->c2.push_request_interval, 5);
}
-#endif
+#endif /* P2MP */
/*
* Things that need to happen immediately after connection initiation should go here.
@@ -328,15 +330,16 @@ check_server_poll_timeout_dowork (struct context *c)
}
/*
- * Schedule a SIGTERM n_seconds from now.
+ * Schedule a signal n_seconds from now.
*/
void
-schedule_exit (struct context *c, const int n_seconds)
+schedule_exit (struct context *c, const int n_seconds, const int signal)
{
tls_set_single_session (c->c2.tls_multi);
update_time ();
reset_coarse_timers (c);
event_timeout_init (&c->c2.scheduled_exit, n_seconds, now);
+ c->c2.scheduled_exit_signal = signal;
msg (D_SCHED_EXIT, "Delayed exit in %d seconds", n_seconds);
}
@@ -346,7 +349,7 @@ schedule_exit (struct context *c, const int n_seconds)
void
check_scheduled_exit_dowork (struct context *c)
{
- c->sig->signal_received = SIGTERM;
+ c->sig->signal_received = c->c2.scheduled_exit_signal;
c->sig->signal_text = "delayed-exit";
}