Skip to content

Commit 25d8b7c

Browse files
Eli Coopergregkh
authored andcommitted
ipv6: Set skb->protocol properly for local output
commit b4e479a96fc398ccf83bb1cffb4ffef8631beaf1 upstream. When xfrm is applied to TSO/GSO packets, it follows this path: xfrm_output() -> xfrm_output_gso() -> skb_gso_segment() where skb_gso_segment() relies on skb->protocol to function properly. This patch sets skb->protocol to ETH_P_IPV6 before dst_output() is called, fixing a bug where GSO packets sent through an ipip6 tunnel are dropped when xfrm is involved. Signed-off-by: Eli Cooper <elicooper@gmx.com> Signed-off-by: David S. Miller <davem@davemloft.net> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
1 parent d41fb2f commit 25d8b7c

1 file changed

Lines changed: 2 additions & 0 deletions

File tree

net/ipv6/output_core.c

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -148,6 +148,8 @@ int __ip6_local_out(struct net *net, struct sock *sk, struct sk_buff *skb)
148148
ipv6_hdr(skb)->payload_len = htons(len);
149149
IP6CB(skb)->nhoff = offsetof(struct ipv6hdr, nexthdr);
150150

151+
skb->protocol = htons(ETH_P_IPV6);
152+
151153
return nf_hook(NFPROTO_IPV6, NF_INET_LOCAL_OUT,
152154
net, sk, skb, NULL, skb_dst(skb)->dev,
153155
dst_output);

0 commit comments

Comments
 (0)