Skip to content

Commit 5211fcf

Browse files
Shannon Nelsonklassert
authored andcommitted
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 <[email protected]> Signed-off-by: Steffen Klassert <[email protected]>
1 parent f8c3d0d commit 5211fcf

File tree

2 files changed

+4
-0
lines changed

2 files changed

+4
-0
lines changed

net/ipv4/esp4_offload.c

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -138,6 +138,8 @@ static struct sk_buff *esp4_gso_segment(struct sk_buff *skb,
138138
if (!(features & NETIF_F_HW_ESP) || !x->xso.offload_handle ||
139139
(x->xso.dev != skb->dev))
140140
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;
141143

142144
xo->flags |= XFRM_GSO_SEGMENT;
143145

net/ipv6/esp6_offload.c

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -165,6 +165,8 @@ static struct sk_buff *esp6_gso_segment(struct sk_buff *skb,
165165
if (!(features & NETIF_F_HW_ESP) || !x->xso.offload_handle ||
166166
(x->xso.dev != skb->dev))
167167
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;
168170

169171
xo->flags |= XFRM_GSO_SEGMENT;
170172

0 commit comments

Comments
 (0)