[<prev] [next>] [thread-next>] [day] [month] [year] [list]
Message-Id: <1401017972-1544-1-git-send-email-pshelar@nicira.com>
Date: Sun, 25 May 2014 04:39:32 -0700
From: Pravin B Shelar <pshelar@...ira.com>
To: netdev@...r.kernel.org
Cc: Pravin B Shelar <pshelar@...ira.com>
Subject: [PATCH 1/2] ip_tunnel: GSO: Add check for nested encap.
Current networking stack can only handle single encap packet
for GSO. Following patch adds check for already encapsulated
packet so that we can drop it.
Signed-off-by: Pravin B Shelar <pshelar@...ira.com>
---
net/ipv4/ip_tunnel_core.c | 10 +++++++---
1 file changed, 7 insertions(+), 3 deletions(-)
diff --git a/net/ipv4/ip_tunnel_core.c b/net/ipv4/ip_tunnel_core.c
index f4c987b..b150546 100644
--- a/net/ipv4/ip_tunnel_core.c
+++ b/net/ipv4/ip_tunnel_core.c
@@ -122,12 +122,16 @@ struct sk_buff *iptunnel_handle_offloads(struct sk_buff *skb,
{
int err;
- if (likely(!skb->encapsulation)) {
+ if (skb_is_gso(skb)) {
+ if (unlikely(skb->encapsulation)) {
+ /* Current networking GSO stack can handle
+ * only one level of encapsulation. */
+ err = -ENOSYS;
+ goto error;
+ }
skb_reset_inner_headers(skb);
skb->encapsulation = 1;
- }
- if (skb_is_gso(skb)) {
err = skb_unclone(skb, GFP_ATOMIC);
if (unlikely(err))
goto error;
--
1.9.1
--
To unsubscribe from this list: send the line "unsubscribe netdev" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Powered by blists - more mailing lists