aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJames Yonan2011-08-19 03:07:27 +0000
committerDavid Sommerseth2011-08-24 13:33:53 +0200
commita3beba0042312a479a706c34d977bb0944f824fd (patch)
tree6245628030c0e95ec940820e7021916b87de172c
parent5455b3989559ee3278b24af5b78b1d750d8aa531 (diff)
downloadopenvpn-a3beba0042312a479a706c34d977bb0944f824fd.zip
openvpn-a3beba0042312a479a706c34d977bb0944f824fd.tar.gz
Fixed issue where redirect-gateway block-local code was not
correctly calculating the two halves of the subnet if the gateway was in the upper half (Gert Doering). git-svn-id: http://svn.openvpn.net/projects/openvpn/branches/BETA21/openvpn@7537 e7ae566f-a301-0410-adde-c780ea21d3b5
-rw-r--r--route.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/route.c b/route.c
index 7843686..4ffb6f5 100644
--- a/route.c
+++ b/route.c
@@ -492,9 +492,9 @@ add_block_local_item (struct route_list *rl,
CLEAR(r);
r.flags = RT_DEFINED;
r.gateway = target;
+ r.network = gateway->addr & gateway->netmask;
l2 = ((~gateway->netmask)+1)>>1;
r.netmask = ~(l2-1);
- r.network = gateway->addr & r.netmask;
rl->routes[rl->n++] = r;
r.network += l2;
rl->routes[rl->n++] = r;