From c70caa7fd4a631f42b136bdcf3c5199774ed09e5 Mon Sep 17 00:00:00 2001 From: james Date: Sat, 1 Oct 2005 11:10:12 +0000 Subject: Renamed sample-keys/tmp-ca.crt to ca.crt. Fixed bug where remove_iroutes_from_push_route_list was missing routes if those routes had an implied netmask (by omission) of 255.255.255.255. git-svn-id: http://svn.openvpn.net/projects/openvpn/branches/BETA21/openvpn@587 e7ae566f-a301-0410-adde-c780ea21d3b5 --- push.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'push.c') diff --git a/push.c b/push.c index 3db8e74..e5c940a 100644 --- a/push.c +++ b/push.c @@ -273,12 +273,12 @@ remove_iroutes_from_push_route_list (struct options *o) if (parse_line (line, p, SIZE (p), "[PUSH_ROUTE_REMOVE]", 1, D_ROUTE_DEBUG, &gc)) { /* is the push item a route directive? */ - if (p[0] && p[1] && p[2] && !strcmp (p[0], "route")) + if (p[0] && !strcmp (p[0], "route") && !p[3]) { /* get route parameters */ bool status1, status2; const in_addr_t network = getaddr (GETADDR_HOST_ORDER, p[1], 0, &status1, NULL); - const in_addr_t netmask = getaddr (GETADDR_HOST_ORDER, p[2], 0, &status2, NULL); + const in_addr_t netmask = getaddr (GETADDR_HOST_ORDER, p[2] ? p[2] : "255.255.255.255", 0, &status2, NULL); /* did route parameters parse correctly? */ if (status1 && status2) @@ -288,7 +288,7 @@ remove_iroutes_from_push_route_list (struct options *o) /* does route match an iroute? */ for (ir = o->iroutes; ir != NULL; ir = ir->next) { - if (network == ir->network && netmask == netbits_to_netmask (ir->netbits)) + if (network == ir->network && netmask == netbits_to_netmask (ir->netbits >= 0 ? ir->netbits : 32)) { copy = false; break; -- cgit