Use source address in get_nexthop() call

Otherwise the nexthop returned might belong to a different route than
the one actually used with the current source address.
This commit is contained in:
Tobias Brunner
2012-09-21 18:16:25 +02:00
parent 662534657f
commit dad6d904ee
8 changed files with 19 additions and 12 deletions
@@ -2174,7 +2174,7 @@ METHOD(kernel_ipsec_t, add_policy, status_t,
/* get the nexthop to dst */
route->gateway = hydra->kernel_interface->get_nexthop(
hydra->kernel_interface, dst);
hydra->kernel_interface, dst, route->src_ip);
route->dst_net = chunk_clone(policy->dst.net->get_address(policy->dst.net));
route->prefixlen = policy->dst.mask;