summaryrefslogtreecommitdiffstats
path: root/push.c
diff options
context:
space:
mode:
authorjames <james@e7ae566f-a301-0410-adde-c780ea21d3b5>2005-10-01 11:10:12 +0000
committerjames <james@e7ae566f-a301-0410-adde-c780ea21d3b5>2005-10-01 11:10:12 +0000
commitc70caa7fd4a631f42b136bdcf3c5199774ed09e5 (patch)
tree61af66570e5380346e90bdbd7f59730b4a9e31c9 /push.c
parentd5bef8ff0c19400626d0900cfddbe2a241492db0 (diff)
downloadopenvpn-c70caa7fd4a631f42b136bdcf3c5199774ed09e5.tar.gz
openvpn-c70caa7fd4a631f42b136bdcf3c5199774ed09e5.tar.xz
openvpn-c70caa7fd4a631f42b136bdcf3c5199774ed09e5.zip
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
Diffstat (limited to 'push.c')
-rw-r--r--push.c6
1 files changed, 3 insertions, 3 deletions
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;