@@ -49,6 +49,7 @@ static struct sk_buff *__skb_udp_tunnel_segment(struct sk_buff *skb,
__skb_pull(skb, tnl_hlen);
skb_reset_mac_header(skb);
skb_set_network_header(skb, skb_inner_network_offset(skb));
+ skb_set_transport_header(skb, skb_inner_transport_offset(skb));
skb->mac_len = skb_inner_network_offset(skb);
skb->protocol = new_protocol;
@@ -131,8 +132,12 @@ static struct sk_buff *__skb_udp_tunnel_segment(struct sk_buff *skb,
uh->check = ~csum_fold(csum_add(partial,
(__force __wsum)htonl(len)));
- if (skb->encapsulation)
- skb_checksum_help(skb);
+ if (skb->encapsulation) {
+ if (skb->csum_not_inet)
+ skb_crc32c_csum_help(skb);
+ else
+ skb_checksum_help(skb);
+ }
if (offload_csum) {
skb->ip_summed = CHECKSUM_PARTIAL;
To call sctp_gso_segment() properly in skb_udp_tunnel_segment() for sctp over udp packets, we need to set transport_header to sctp header. When skb->ip_summed == CHECKSUM_PARTIAL, skb_crc32c_csum_help() should be called for the inner sctp packet. Signed-off-by: Xin Long <lucien.xin@gmail.com> --- net/ipv4/udp_offload.c | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-)