Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

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>

authored by

Shannon Nelson and committed by
Steffen Klassert
5211fcfb f8c3d0dd

+4
+2
net/ipv4/esp4_offload.c
··· 138 138 if (!(features & NETIF_F_HW_ESP) || !x->xso.offload_handle || 139 139 (x->xso.dev != skb->dev)) 140 140 esp_features = features & ~(NETIF_F_SG | NETIF_F_CSUM_MASK); 141 + else if (!(features & NETIF_F_HW_ESP_TX_CSUM)) 142 + esp_features = features & ~NETIF_F_CSUM_MASK; 141 143 142 144 xo->flags |= XFRM_GSO_SEGMENT; 143 145
+2
net/ipv6/esp6_offload.c
··· 165 165 if (!(features & NETIF_F_HW_ESP) || !x->xso.offload_handle || 166 166 (x->xso.dev != skb->dev)) 167 167 esp_features = features & ~(NETIF_F_SG | NETIF_F_CSUM_MASK); 168 + else if (!(features & NETIF_F_HW_ESP_TX_CSUM)) 169 + esp_features = features & ~NETIF_F_CSUM_MASK; 168 170 169 171 xo->flags |= XFRM_GSO_SEGMENT; 170 172