mirror of
https://github.com/strongswan/strongswan.git
synced 2025-10-05 00:00:45 -04:00
Make sure the if_name member of cached route entries is initialized to NULL
This commit is contained in:
parent
04bb739578
commit
f65ec0aa90
@ -2159,8 +2159,12 @@ static status_t add_policy_internal(private_kernel_netlink_ipsec_t *this,
|
||||
if (policy->direction == POLICY_FWD &&
|
||||
ipsec->cfg.mode != MODE_TRANSPORT && this->install_routes)
|
||||
{
|
||||
route_entry_t *route = malloc_thing(route_entry_t);
|
||||
policy_sa_fwd_t *fwd = (policy_sa_fwd_t*)mapping;
|
||||
route_entry_t *route;
|
||||
|
||||
INIT(route,
|
||||
.prefixlen = policy->sel.prefixlen_s,
|
||||
);
|
||||
|
||||
if (hydra->kernel_interface->get_address_by_ts(hydra->kernel_interface,
|
||||
fwd->dst_ts, &route->src_ip) == SUCCESS)
|
||||
@ -2171,7 +2175,6 @@ static status_t add_policy_internal(private_kernel_netlink_ipsec_t *this,
|
||||
ipsec->dst);
|
||||
route->dst_net = chunk_alloc(policy->sel.family == AF_INET ? 4 : 16);
|
||||
memcpy(route->dst_net.ptr, &policy->sel.saddr, route->dst_net.len);
|
||||
route->prefixlen = policy->sel.prefixlen_s;
|
||||
|
||||
/* install route via outgoing interface */
|
||||
if (!hydra->kernel_interface->get_interface(hydra->kernel_interface,
|
||||
|
@ -2018,8 +2018,12 @@ static status_t add_policy_internal(private_kernel_pfkey_ipsec_t *this,
|
||||
if (policy->direction == POLICY_FWD &&
|
||||
ipsec->cfg.mode != MODE_TRANSPORT && this->install_routes)
|
||||
{
|
||||
route_entry_t *route = malloc_thing(route_entry_t);
|
||||
policy_sa_fwd_t *fwd = (policy_sa_fwd_t*)mapping;
|
||||
route_entry_t *route;
|
||||
|
||||
INIT(route,
|
||||
.prefixlen = policy->src.mask,
|
||||
);
|
||||
|
||||
if (hydra->kernel_interface->get_address_by_ts(hydra->kernel_interface,
|
||||
fwd->dst_ts, &route->src_ip) == SUCCESS)
|
||||
@ -2030,7 +2034,6 @@ static status_t add_policy_internal(private_kernel_pfkey_ipsec_t *this,
|
||||
ipsec->dst);
|
||||
route->dst_net = chunk_clone(policy->src.net->get_address(
|
||||
policy->src.net));
|
||||
route->prefixlen = policy->src.mask;
|
||||
|
||||
/* install route via outgoing interface */
|
||||
if (!hydra->kernel_interface->get_interface(hydra->kernel_interface,
|
||||
|
Loading…
x
Reference in New Issue
Block a user