aboutsummaryrefslogtreecommitdiff
path: root/push.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 /push.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 'push.c')
-rw-r--r--push.c28
1 files changed, 27 insertions, 1 deletions
diff --git a/push.c b/push.c
index 142222b..f817c87 100644
--- a/push.c
+++ b/push.c
@@ -72,7 +72,22 @@ receive_auth_failed (struct context *c, const struct buffer *buffer)
}
}
+/*
+ * Act on received restart message from server
+ */
+void
+server_pushed_restart (struct context *c, const struct buffer *buffer)
+{
+ if (c->options.pull)
+ {
+ msg (D_STREAM_ERRORS, "Connection reset command was pushed by server");
+ c->sig->signal_received = SIGUSR1; /* SOFT-SIGUSR1 -- server-pushed connection reset */
+ c->sig->signal_text = "server-pushed-connection-reset";
+ }
+}
+
#if P2MP_SERVER
+
/*
* Send auth failed message from server to client.
*/
@@ -83,7 +98,7 @@ send_auth_failed (struct context *c, const char *client_reason)
static const char auth_failed[] = "AUTH_FAILED";
size_t len;
- schedule_exit (c, c->options.scheduled_exit_interval);
+ schedule_exit (c, c->options.scheduled_exit_interval, SIGTERM);
len = (client_reason ? strlen(client_reason)+1 : 0) + sizeof(auth_failed);
if (len > TLS_CHANNEL_BUF_SIZE)
@@ -99,6 +114,17 @@ send_auth_failed (struct context *c, const char *client_reason)
gc_free (&gc);
}
+
+/*
+ * Send restart message from server to client.
+ */
+void
+send_restart (struct context *c)
+{
+ schedule_exit (c, c->options.scheduled_exit_interval, SIGTERM);
+ send_control_channel_string (c, "RESTART", D_PUSH);
+}
+
#endif
/*