All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH 1/2] ip_tunnel: GSO: Add check for nested encap.
@ 2014-05-25 11:39 Pravin B Shelar
  2014-06-10 15:34 ` Tom Herbert
  2014-06-11  5:21 ` David Miller
  0 siblings, 2 replies; 7+ messages in thread
From: Pravin B Shelar @ 2014-05-25 11:39 UTC (permalink / raw)
  To: netdev; +Cc: Pravin B Shelar

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@nicira.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

^ permalink raw reply related	[flat|nested] 7+ messages in thread

end of thread, other threads:[~2014-06-12 20:56 UTC | newest]

Thread overview: 7+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2014-05-25 11:39 [PATCH 1/2] ip_tunnel: GSO: Add check for nested encap Pravin B Shelar
2014-06-10 15:34 ` Tom Herbert
2014-06-12 15:32   ` Pravin Shelar
2014-06-12 17:48     ` Tom Herbert
2014-06-12 20:56       ` Pravin Shelar
2014-06-11  5:21 ` David Miller
2014-06-12 15:35   ` Pravin Shelar

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.