From 3eee126eba7314e203a50b6398fa5333cbf12ff7 Mon Sep 17 00:00:00 2001 From: james Date: Sun, 27 Sep 2009 02:12:15 +0000 Subject: 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 --- options.c | 26 ++++++++++++++++---------- 1 file changed, 16 insertions(+), 10 deletions(-) (limited to 'options.c') diff --git a/options.c b/options.c index c1692e7..ce16b56 100644 --- a/options.c +++ b/options.c @@ -960,11 +960,15 @@ show_p2mp_parms (const struct options *o) msg (D_SHOW_PARMS, " server_bridge_netmask = %s", print_in_addr_t (o->server_bridge_netmask, 0, &gc)); msg (D_SHOW_PARMS, " server_bridge_pool_start = %s", print_in_addr_t (o->server_bridge_pool_start, 0, &gc)); msg (D_SHOW_PARMS, " server_bridge_pool_end = %s", print_in_addr_t (o->server_bridge_pool_end, 0, &gc)); - if (o->push_list) + if (o->push_list.head) { - const struct push_list *l = o->push_list; - const char *printable_push_list = l->options; - msg (D_SHOW_PARMS, " push_list = '%s'", printable_push_list); + const struct push_entry *e = o->push_list.head; + while (e) + { + if (e->enable) + msg (D_SHOW_PARMS, " push_entry = '%s'", e->option); + e = e->next; + } } SHOW_BOOL (ifconfig_pool_defined); msg (D_SHOW_PARMS, " ifconfig_pool_start = %s", print_in_addr_t (o->ifconfig_pool_start, 0, &gc)); @@ -1065,12 +1069,7 @@ options_detach (struct options *o) gc_detach (&o->gc); o->routes = NULL; #if P2MP_SERVER - if (o->push_list) /* clone push_list */ - { - const struct push_list *old = o->push_list; - ALLOC_OBJ_GC (o->push_list, struct push_list, &o->gc); - strcpy (o->push_list->options, old->options); - } + clone_push_list(o); #endif } @@ -2190,6 +2189,8 @@ pre_pull_restore (struct options *o) o->foreign_option_index = pp->foreign_option_index; } + + o->push_continuation = 0; } #endif @@ -4881,6 +4882,11 @@ add_option (struct options *options, VERIFY_PERMISSION (OPT_P_GENERAL); options->pull = true; } + else if (streq (p[0], "push-continuation") && p[1]) + { + VERIFY_PERMISSION (OPT_P_PULL_MODE); + options->push_continuation = atoi(p[1]); + } else if (streq (p[0], "auth-user-pass")) { VERIFY_PERMISSION (OPT_P_GENERAL); -- cgit