From: Eli Cooper <elicooper@gmx.com>
To: netdev@vger.kernel.org, "David S . Miller" <davem@davemloft.net>
Cc: Eric Dumazet <eric.dumazet@gmail.com>
Subject: [PATCH net 1/2] Set skb->protocol properly before calling dst_output()
Date: Tue, 29 Nov 2016 10:35:28 +0800 [thread overview]
Message-ID: <20161129023529.17645-1-elicooper@gmx.com> (raw)
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 properly before dst_output() is called,
fixing a bug where GSO packets sent through a sit or ipip6 tunnel are
dropped when xfrm is involved.
Cc: stable@vger.kernel.org
Signed-off-by: Eli Cooper <elicooper@gmx.com>
---
net/ipv4/ip_output.c | 4 +++-
net/ipv6/output_core.c | 4 +++-
2 files changed, 6 insertions(+), 2 deletions(-)
diff --git a/net/ipv4/ip_output.c b/net/ipv4/ip_output.c
index 105908d..0180e44 100644
--- a/net/ipv4/ip_output.c
+++ b/net/ipv4/ip_output.c
@@ -117,8 +117,10 @@ int ip_local_out(struct net *net, struct sock *sk, struct sk_buff *skb)
int err;
err = __ip_local_out(net, sk, skb);
- if (likely(err == 1))
+ if (likely(err == 1)) {
+ skb->protocol = htons(ETH_P_IP);
err = dst_output(net, sk, skb);
+ }
return err;
}
diff --git a/net/ipv6/output_core.c b/net/ipv6/output_core.c
index 7cca8ac..d6e850d 100644
--- a/net/ipv6/output_core.c
+++ b/net/ipv6/output_core.c
@@ -166,8 +166,10 @@ int ip6_local_out(struct net *net, struct sock *sk, struct sk_buff *skb)
int err;
err = __ip6_local_out(net, sk, skb);
- if (likely(err == 1))
+ if (likely(err == 1)) {
+ skb->protocol = htons(ETH_P_IPV6);
err = dst_output(net, sk, skb);
+ }
return err;
}
--
2.10.2
next reply other threads:[~2016-11-29 2:35 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2016-11-29 2:35 Eli Cooper [this message]
2016-11-29 2:35 ` [PATCH net 2/2] Revert: "ip6_tunnel: Update skb->protocol to ETH_P_IPV6 in ip6_tnl_xmit()" Eli Cooper
2016-11-30 17:38 ` [PATCH net 1/2] Set skb->protocol properly before calling dst_output() David Miller
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20161129023529.17645-1-elicooper@gmx.com \
--to=elicooper@gmx.com \
--cc=davem@davemloft.net \
--cc=eric.dumazet@gmail.com \
--cc=netdev@vger.kernel.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox