summaryrefslogtreecommitdiffstats
path: root/init.c
diff options
context:
space:
mode:
authorjames <james@e7ae566f-a301-0410-adde-c780ea21d3b5>2009-09-27 02:12:15 +0000
committerjames <james@e7ae566f-a301-0410-adde-c780ea21d3b5>2009-09-27 02:12:15 +0000
commit3eee126eba7314e203a50b6398fa5333cbf12ff7 (patch)
tree2b07c330d53e1346c5383bfefe1a997d54bbde7c /init.c
parent673f583f76358b57e7f610084d3cb28bb2a9c4a2 (diff)
downloadopenvpn-3eee126eba7314e203a50b6398fa5333cbf12ff7.tar.gz
openvpn-3eee126eba7314e203a50b6398fa5333cbf12ff7.tar.xz
openvpn-3eee126eba7314e203a50b6398fa5333cbf12ff7.zip
Eliminated the limitation on the number of options that can be pushed
to clients, including routes. Previously, all pushed options needed to fit within a 1024 byte options string. Remember that to make use of this feature to allow many routes to be pushed to clients, the client config file must specify the max-routes option, and the number of pushed routes cannot exceed this limit. Also, both server and client must include this commit. git-svn-id: http://svn.openvpn.net/projects/openvpn/branches/BETA21/openvpn@4991 e7ae566f-a301-0410-adde-c780ea21d3b5
Diffstat (limited to 'init.c')
-rw-r--r--init.c21
1 files changed, 9 insertions, 12 deletions
diff --git a/init.c b/init.c
index a2821b9..9d29af7 100644
--- a/init.c
+++ b/init.c
@@ -992,15 +992,12 @@ do_route (const struct options *options,
*/
#if P2MP
static void
-save_pulled_options_string (struct context *c, const char *newstring)
+save_pulled_options_digest (struct context *c, const struct md5_digest *newdigest)
{
- if (c->c1.pulled_options_string_save)
- free (c->c1.pulled_options_string_save);
-
- c->c1.pulled_options_string_save = NULL;
-
- if (newstring)
- c->c1.pulled_options_string_save = string_alloc (newstring, NULL);
+ if (newdigest)
+ c->c1.pulled_options_digest_save = *newdigest;
+ else
+ md5_digest_clear (&c->c1.pulled_options_digest_save);
}
#endif
@@ -1144,7 +1141,7 @@ do_close_tun_simple (struct context *c)
c->c1.tuntap = NULL;
c->c1.tuntap_owned = false;
#if P2MP
- save_pulled_options_string (c, NULL); /* delete C1-saved pulled_options_string */
+ save_pulled_options_digest (c, NULL); /* delete C1-saved pulled_options_digest */
#endif
}
@@ -1244,8 +1241,8 @@ do_up (struct context *c, bool pulled_options, unsigned int option_types_found)
if (!c->c2.did_open_tun
&& PULL_DEFINED (&c->options)
&& c->c1.tuntap
- && (!c->c1.pulled_options_string_save || !c->c2.pulled_options_string
- || strcmp (c->c1.pulled_options_string_save, c->c2.pulled_options_string)))
+ && (!md5_digest_defined (&c->c1.pulled_options_digest_save) || !md5_digest_defined (&c->c2.pulled_options_digest)
+ || !md5_digest_equal (&c->c1.pulled_options_digest_save, &c->c2.pulled_options_digest)))
{
/* if so, close tun, delete routes, then reinitialize tun and add routes */
msg (M_INFO, "NOTE: Pulled options changed on restart, will need to close and reopen TUN/TAP device.");
@@ -1260,7 +1257,7 @@ do_up (struct context *c, bool pulled_options, unsigned int option_types_found)
if (c->c2.did_open_tun)
{
#if P2MP
- save_pulled_options_string (c, c->c2.pulled_options_string);
+ save_pulled_options_digest (c, &c->c2.pulled_options_digest);
#endif
/* if --route-delay was specified, start timer */