From: James Yonan Date: Fri, 19 Aug 2011 03:07:27 +0000 (+0000) Subject: Fixed issue where redirect-gateway block-local code was not X-Git-Tag: v2.3-alpha1~206 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=a3beba0042312a479a706c34d977bb0944f824fd;p=thirdparty%2Fopenvpn.git 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 --- diff --git a/route.c b/route.c index 7843686ab..4ffb6f51a 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;