kernel-netlink: Add support to set CPU ID on SA
This commit is contained in:
@@ -95,6 +95,8 @@ struct kernel_ipsec_add_sa_t {
|
|||||||
uint16_t ipcomp;
|
uint16_t ipcomp;
|
||||||
/** CPI for IPComp */
|
/** CPI for IPComp */
|
||||||
uint16_t cpi;
|
uint16_t cpi;
|
||||||
|
/** Optional CPU ID, must be CPU_ID_MAX if not used */
|
||||||
|
uint32_t cpu;
|
||||||
/** TRUE to enable UDP encapsulation for NAT traversal */
|
/** TRUE to enable UDP encapsulation for NAT traversal */
|
||||||
bool encap;
|
bool encap;
|
||||||
/** HW offload mode */
|
/** HW offload mode */
|
||||||
|
|||||||
@@ -1725,6 +1725,7 @@ METHOD(kernel_ipsec_t, add_sa, status_t,
|
|||||||
.int_alg = AUTH_UNDEFINED,
|
.int_alg = AUTH_UNDEFINED,
|
||||||
.tfc = data->tfc,
|
.tfc = data->tfc,
|
||||||
.ipcomp = data->ipcomp,
|
.ipcomp = data->ipcomp,
|
||||||
|
.cpu = data->cpu,
|
||||||
.initiator = data->initiator,
|
.initiator = data->initiator,
|
||||||
.inbound = data->inbound,
|
.inbound = data->inbound,
|
||||||
.update = data->update,
|
.update = data->update,
|
||||||
@@ -2084,6 +2085,15 @@ METHOD(kernel_ipsec_t, add_sa, status_t,
|
|||||||
goto failed;
|
goto failed;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (data->cpu != CPU_ID_MAX)
|
||||||
|
{
|
||||||
|
if (!add_uint32(hdr, sizeof(request), XFRMA_SA_PCPU, data->cpu))
|
||||||
|
{
|
||||||
|
goto failed;
|
||||||
|
}
|
||||||
|
DBG2(DBG_KNL, " using CPU ID: %u", data->cpu);
|
||||||
|
}
|
||||||
|
|
||||||
if (id->proto != IPPROTO_COMP)
|
if (id->proto != IPPROTO_COMP)
|
||||||
{
|
{
|
||||||
/* we don't need a replay window for outbound SAs, however, older
|
/* we don't need a replay window for outbound SAs, however, older
|
||||||
|
|||||||
@@ -1054,6 +1054,7 @@ static status_t install_internal(private_child_sa_t *this, chunk_t encr,
|
|||||||
.ipcomp = this->ipcomp,
|
.ipcomp = this->ipcomp,
|
||||||
.cpi = cpi,
|
.cpi = cpi,
|
||||||
.encap = this->encap,
|
.encap = this->encap,
|
||||||
|
.cpu = CPU_ID_MAX,
|
||||||
.hw_offload = this->config->get_hw_offload(this->config),
|
.hw_offload = this->config->get_hw_offload(this->config),
|
||||||
.mark = this->config->get_set_mark(this->config, inbound),
|
.mark = this->config->get_set_mark(this->config, inbound),
|
||||||
.esn = esn,
|
.esn = esn,
|
||||||
|
|||||||
Reference in New Issue
Block a user