kernel-interface: Pass full list of traffic selectors to add_sa()
While we can handle the first selector only in BEET mode in kernel-netlink, passing the full list gives the backend more flexibility how to handle this information.
This commit is contained in:
@@ -255,7 +255,7 @@ METHOD(kernel_ipsec_t, add_sa, status_t,
|
||||
u_int16_t int_alg, chunk_t int_key, ipsec_mode_t mode,
|
||||
u_int16_t ipcomp, u_int16_t cpi, u_int32_t replay_window,
|
||||
bool initiator, bool encap, bool esn, bool inbound,
|
||||
traffic_selector_t *src_ts, traffic_selector_t *dst_ts)
|
||||
linked_list_t *src_ts, linked_list_t *dst_ts)
|
||||
{
|
||||
return ipsec->sas->add_sa(ipsec->sas, src, dst, spi, protocol, reqid, mark,
|
||||
tfc, lifetime, enc_alg, enc_key, int_alg, int_key,
|
||||
|
||||
@@ -2107,7 +2107,7 @@ METHOD(kernel_ipsec_t, add_sa, status_t,
|
||||
u_int16_t int_alg, chunk_t int_key, ipsec_mode_t mode,
|
||||
u_int16_t ipcomp, u_int16_t cpi, u_int32_t replay_window,
|
||||
bool initiator, bool encap, bool esn, bool inbound,
|
||||
traffic_selector_t *src_ts, traffic_selector_t *dst_ts)
|
||||
linked_list_t *src_ts, linked_list_t *dst_ts)
|
||||
{
|
||||
host_t *local, *remote;
|
||||
entry_t *entry;
|
||||
|
||||
@@ -56,7 +56,7 @@ METHOD(kernel_ipsec_t, add_sa, status_t,
|
||||
u_int16_t int_alg, chunk_t int_key, ipsec_mode_t mode,
|
||||
u_int16_t ipcomp, u_int16_t cpi, u_int32_t replay_window,
|
||||
bool initiator, bool encap, bool esn, bool inbound,
|
||||
traffic_selector_t *src_ts, traffic_selector_t *dst_ts)
|
||||
linked_list_t *src_ts, linked_list_t *dst_ts)
|
||||
{
|
||||
return SUCCESS;
|
||||
}
|
||||
|
||||
@@ -633,7 +633,7 @@ METHOD(child_sa_t, install, status_t,
|
||||
{
|
||||
u_int16_t enc_alg = ENCR_UNDEFINED, int_alg = AUTH_UNDEFINED, size;
|
||||
u_int16_t esn = NO_EXT_SEQ_NUMBERS;
|
||||
traffic_selector_t *src_ts = NULL, *dst_ts = NULL;
|
||||
linked_list_t *src_ts = NULL, *dst_ts = NULL;
|
||||
time_t now;
|
||||
lifetime_cfg_t *lifetime;
|
||||
u_int32_t tfc = 0;
|
||||
@@ -705,18 +705,16 @@ METHOD(child_sa_t, install, status_t,
|
||||
lifetime->time.rekey = 0;
|
||||
}
|
||||
|
||||
/* BEET requires the bound address from the traffic selectors.
|
||||
* TODO: We add just the first traffic selector for now, as the
|
||||
* kernel accepts a single TS per SA only */
|
||||
/* BEET requires the bound address from the traffic selectors */
|
||||
if (inbound)
|
||||
{
|
||||
my_ts->get_first(my_ts, (void**)&dst_ts);
|
||||
other_ts->get_first(other_ts, (void**)&src_ts);
|
||||
dst_ts = my_ts;
|
||||
src_ts = other_ts;
|
||||
}
|
||||
else
|
||||
{
|
||||
my_ts->get_first(my_ts, (void**)&src_ts);
|
||||
other_ts->get_first(other_ts, (void**)&dst_ts);
|
||||
src_ts = my_ts;
|
||||
dst_ts = other_ts;
|
||||
}
|
||||
|
||||
status = hydra->kernel_interface->add_sa(hydra->kernel_interface,
|
||||
|
||||
Reference in New Issue
Block a user