kernel: Add options to control DF and ECN header bits/fields via XFRM
The options control whether the DF and ECN header bits/fields are copied from the unencrypted packets to the encrypted packets in tunnel mode (DF only for IPv4), and for ECN whether the same is done for inbound packets. Note: This implementation only works with Linux/Netlink/XFRM. Based on a patch by Markus Sattler.
This commit is contained in:
@@ -1586,6 +1586,17 @@ METHOD(kernel_ipsec_t, add_sa, status_t,
|
||||
sa->id.proto = id->proto;
|
||||
sa->family = id->src->get_family(id->src);
|
||||
sa->mode = mode2kernel(mode);
|
||||
|
||||
if (!data->copy_df)
|
||||
{
|
||||
sa->flags |= XFRM_STATE_NOPMTUDISC;
|
||||
}
|
||||
|
||||
if (!data->copy_ecn)
|
||||
{
|
||||
sa->flags |= XFRM_STATE_NOECN;
|
||||
}
|
||||
|
||||
switch (mode)
|
||||
{
|
||||
case MODE_TUNNEL:
|
||||
|
||||
Reference in New Issue
Block a user