summaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorArne Schwabe <arne@rfc2549.org>2012-11-19 19:12:17 +0100
committerDavid Sommerseth <davids@redhat.com>2012-11-22 11:39:20 +0100
commitf83ccec6525179968b68696acb6ccf22182fc6de (patch)
treeab0d1d643a719f602cf37c7bcd12d1f0746ca089 /src
parent5fd3e56430678bee3e6e3a3cf8dfd6db7e105676 (diff)
downloadopenvpn-f83ccec6525179968b68696acb6ccf22182fc6de.tar.gz
openvpn-f83ccec6525179968b68696acb6ccf22182fc6de.tar.xz
openvpn-f83ccec6525179968b68696acb6ccf22182fc6de.zip
Error message if max-routes used incorrectly
the route/route-ipv6/redirect-gateway options allocate the route structe with max_routes number of routes. A max-routes after any of this commands has no effect. This can be problematic (http://code.google.com/p/ics-openvpn/issues/detail?id=101) Signed-off-by: Arne Schwabe <arne@rfc2549.org> Acked-by: Gert Doering <gert@greenie.muc.de> Message-Id: 1353348737-21920-1-git-send-email-arne@rfc2549.org URL: http://article.gmane.org/gmane.network.openvpn.devel/7131 Signed-off-by: David Sommerseth <davids@redhat.com>
Diffstat (limited to 'src')
-rw-r--r--src/openvpn/options.c5
1 files changed, 5 insertions, 0 deletions
diff --git a/src/openvpn/options.c b/src/openvpn/options.c
index 9baa4ff..5cec344 100644
--- a/src/openvpn/options.c
+++ b/src/openvpn/options.c
@@ -5141,6 +5141,11 @@ add_option (struct options *options,
msg (msglevel, "--max-routes parameter is out of range");
goto err;
}
+ if (options->routes || options->routes_ipv6)
+ {
+ msg (msglevel, "--max-routes must to be specifed before any route/route-ipv6/redirect-gateway option");
+ goto err;
+ }
options->max_routes = max_routes;
}
else if (streq (p[0], "route-gateway") && p[1])