]> git.ipfire.org Git - thirdparty/openvpn.git/commitdiff
Fixed issue where redirect-gateway block-local code was not
authorJames Yonan <james@openvpn.net>
Fri, 19 Aug 2011 03:07:27 +0000 (03:07 +0000)
committerDavid Sommerseth <davids@redhat.com>
Wed, 24 Aug 2011 11:33:53 +0000 (13:33 +0200)
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

route.c

diff --git a/route.c b/route.c
index 7843686ab3eb579ed1d105669d164a67d9092377..4ffb6f51a1162fc91ecbed9c67fadf1e351f7495 100644 (file)
--- 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;