diff options
author | Shannon Nelson <shannon.nelson@oracle.com> | 2018-02-26 14:28:19 -0800 |
---|---|---|
committer | Steffen Klassert <steffen.klassert@secunet.com> | 2018-02-27 10:46:01 +0100 |
commit | 5211fcfb8110f77ff9f389e476563345817f61a5 (patch) | |
tree | 1715dae8905915f7650306b55804522ad1662bc7 /net/ipv4 | |
parent | f8c3d0dda4b09e05ad8781764cbe153815c1bf23 (diff) |
esp: check the NETIF_F_HW_ESP_TX_CSUM bit before segmenting
If I understand correctly, we should not be asking for a
checksum offload on an ipsec packet if the netdev isn't
advertising NETIF_F_HW_ESP_TX_CSUM. In that case, we should
clear the NETIF_F_CSUM_MASK bits.
Signed-off-by: Shannon Nelson <shannon.nelson@oracle.com>
Signed-off-by: Steffen Klassert <steffen.klassert@secunet.com>
Diffstat (limited to 'net/ipv4')
-rw-r--r-- | net/ipv4/esp4_offload.c | 2 |
1 files changed, 2 insertions, 0 deletions
diff --git a/net/ipv4/esp4_offload.c b/net/ipv4/esp4_offload.c index da5635fc52c2..7cf755ef9efb 100644 --- a/net/ipv4/esp4_offload.c +++ b/net/ipv4/esp4_offload.c @@ -138,6 +138,8 @@ static struct sk_buff *esp4_gso_segment(struct sk_buff *skb, if (!(features & NETIF_F_HW_ESP) || !x->xso.offload_handle || (x->xso.dev != skb->dev)) esp_features = features & ~(NETIF_F_SG | NETIF_F_CSUM_MASK); + else if (!(features & NETIF_F_HW_ESP_TX_CSUM)) + esp_features = features & ~NETIF_F_CSUM_MASK; xo->flags |= XFRM_GSO_SEGMENT; |