kernel-netlink: Enable TFC padding only for tunnel mode ESP SAs
The kernel does not allow them for transport mode SAs or IPComp SAs (and of course not for AH SAs). Fixes #446.
This commit is contained in:
@@ -1459,8 +1459,8 @@ METHOD(kernel_ipsec_t, add_sa, status_t,
|
|||||||
goto failed;
|
goto failed;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (tfc)
|
if (tfc && protocol == IPPROTO_ESP && mode == MODE_TUNNEL)
|
||||||
{
|
{ /* the kernel supports TFC padding only for tunnel mode ESP SAs */
|
||||||
u_int32_t *tfcpad;
|
u_int32_t *tfcpad;
|
||||||
|
|
||||||
tfcpad = netlink_reserve(hdr, sizeof(request), XFRMA_TFCPAD,
|
tfcpad = netlink_reserve(hdr, sizeof(request), XFRMA_TFCPAD,
|
||||||
|
|||||||
Reference in New Issue
Block a user