Fixed BEET mode by installing SAs with negotiated address in traffic selector
This commit is contained in:
@@ -77,7 +77,8 @@ static status_t add_sa(private_kernel_interface_t *this, host_t *src, host_t *ds
|
||||
u_int16_t enc_alg, chunk_t enc_key,
|
||||
u_int16_t int_alg, chunk_t int_key,
|
||||
ipsec_mode_t mode, u_int16_t ipcomp, u_int16_t cpi, bool encap,
|
||||
bool inbound)
|
||||
bool inbound, traffic_selector_t *src_ts,
|
||||
traffic_selector_t *dst_ts)
|
||||
{
|
||||
if (!this->ipsec)
|
||||
{
|
||||
@@ -85,7 +86,7 @@ static status_t add_sa(private_kernel_interface_t *this, host_t *src, host_t *ds
|
||||
}
|
||||
return this->ipsec->add_sa(this->ipsec, src, dst, spi, protocol, reqid,
|
||||
lifetime, enc_alg, enc_key, int_alg, int_key, mode, ipcomp, cpi,
|
||||
encap, inbound);
|
||||
encap, inbound, src_ts, dst_ts);
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -398,7 +399,7 @@ kernel_interface_t *kernel_interface_create()
|
||||
|
||||
this->public.get_spi = (status_t(*)(kernel_interface_t*,host_t*,host_t*,protocol_id_t,u_int32_t,u_int32_t*))get_spi;
|
||||
this->public.get_cpi = (status_t(*)(kernel_interface_t*,host_t*,host_t*,u_int32_t,u_int16_t*))get_cpi;
|
||||
this->public.add_sa = (status_t(*)(kernel_interface_t *,host_t*,host_t*,u_int32_t,protocol_id_t,u_int32_t,lifetime_cfg_t*,u_int16_t,chunk_t,u_int16_t,chunk_t,ipsec_mode_t,u_int16_t,u_int16_t,bool,bool))add_sa;
|
||||
this->public.add_sa = (status_t(*)(kernel_interface_t *,host_t*,host_t*,u_int32_t,protocol_id_t,u_int32_t,lifetime_cfg_t*,u_int16_t,chunk_t,u_int16_t,chunk_t,ipsec_mode_t,u_int16_t,u_int16_t,bool,bool,traffic_selector_t*,traffic_selector_t*))add_sa;
|
||||
this->public.update_sa = (status_t(*)(kernel_interface_t*,u_int32_t,protocol_id_t,u_int16_t,host_t*,host_t*,host_t*,host_t*,bool,bool))update_sa;
|
||||
this->public.query_sa = (status_t(*)(kernel_interface_t*,host_t*,host_t*,u_int32_t,protocol_id_t,u_int64_t*))query_sa;
|
||||
this->public.del_sa = (status_t(*)(kernel_interface_t*,host_t*,host_t*,u_int32_t,protocol_id_t,u_int16_t))del_sa;
|
||||
|
||||
@@ -100,6 +100,8 @@ struct kernel_interface_t {
|
||||
* @param cpi CPI for IPComp
|
||||
* @param encap enable UDP encapsulation for NAT traversal
|
||||
* @param inbound TRUE if this is an inbound SA
|
||||
* @param src_ts traffic selector with BEET source address
|
||||
* @param dst_ts traffic selector with BEET destination address
|
||||
* @return SUCCESS if operation completed
|
||||
*/
|
||||
status_t (*add_sa) (kernel_interface_t *this,
|
||||
@@ -109,7 +111,8 @@ struct kernel_interface_t {
|
||||
u_int16_t enc_alg, chunk_t enc_key,
|
||||
u_int16_t int_alg, chunk_t int_key,
|
||||
ipsec_mode_t mode, u_int16_t ipcomp, u_int16_t cpi,
|
||||
bool encap, bool inbound);
|
||||
bool encap, bool inbound,
|
||||
traffic_selector_t *src_ts, traffic_selector_t *dst_ts);
|
||||
|
||||
/**
|
||||
* Update the hosts on an installed SA.
|
||||
|
||||
@@ -18,8 +18,6 @@
|
||||
ENUM(ipsec_mode_names, MODE_TRANSPORT, MODE_BEET,
|
||||
"TRANSPORT",
|
||||
"TUNNEL",
|
||||
"2",
|
||||
"3",
|
||||
"BEET",
|
||||
);
|
||||
|
||||
|
||||
@@ -131,6 +131,8 @@ struct kernel_ipsec_t {
|
||||
* @param cpi CPI for IPComp
|
||||
* @param encap enable UDP encapsulation for NAT traversal
|
||||
* @param inbound TRUE if this is an inbound SA
|
||||
* @param src_ts traffic selector with BEET source address
|
||||
* @param dst_ts traffic selector with BEET destination address
|
||||
* @return SUCCESS if operation completed
|
||||
*/
|
||||
status_t (*add_sa) (kernel_ipsec_t *this,
|
||||
@@ -140,7 +142,8 @@ struct kernel_ipsec_t {
|
||||
u_int16_t enc_alg, chunk_t enc_key,
|
||||
u_int16_t int_alg, chunk_t int_key,
|
||||
ipsec_mode_t mode, u_int16_t ipcomp, u_int16_t cpi,
|
||||
bool encap, bool inbound);
|
||||
bool encap, bool inbound,
|
||||
traffic_selector_t *src_ts, traffic_selector_t *dst_ts);
|
||||
|
||||
/**
|
||||
* Update the hosts on an installed SA.
|
||||
|
||||
Reference in New Issue
Block a user