netdev.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* tunnel xmit and h.raw
@ 2003-10-03  0:00 Julian Anastasov
  2003-10-03 14:30 ` David S. Miller
  2003-10-07 15:32 ` David S. Miller
  0 siblings, 2 replies; 7+ messages in thread
From: Julian Anastasov @ 2003-10-03  0:00 UTC (permalink / raw)
  To: David S. Miller; +Cc: netdev


	Hello,

	Is the following change needed? May be yes for all kernels
where the nearest skb_shared checks are actual.

# This is a BitKeeper generated patch for the following project:
# Project Name: Linux kernel tree
# This patch format is intended for GNU patch command version 2.5 or higher.
# This patch includes the following deltas:
#	           ChangeSet	1.1356  -> 1.1357 
#	   net/ipv4/ip_gre.c	1.30    -> 1.31   
#	      net/ipv6/sit.c	1.28    -> 1.29   
#	     net/ipv4/ipip.c	1.32    -> 1.33   
#
# The following is the BitKeeper ChangeSet Log
# --------------------------------------------
# 03/10/03	ja@ssi.bg	1.1357
# [IPV4/IPV6]: tunnel xmit must load skb->h.raw after all reallocations
# --------------------------------------------
#
diff -Nru a/net/ipv4/ip_gre.c b/net/ipv4/ip_gre.c
--- a/net/ipv4/ip_gre.c	Fri Oct  3 02:43:29 2003
+++ b/net/ipv4/ip_gre.c	Fri Oct  3 02:43:29 2003
@@ -803,8 +803,6 @@
 			tunnel->err_count = 0;
 	}
 
-	skb->h.raw = skb->nh.raw;
-
 	max_headroom = LL_RESERVED_SPACE(tdev) + gre_hlen;
 
 	if (skb_headroom(skb) < max_headroom || skb_cloned(skb) || skb_shared(skb)) {
@@ -823,6 +821,7 @@
 		old_iph = skb->nh.iph;
 	}
 
+	skb->h.raw = skb->nh.raw;
 	skb->nh.raw = skb_push(skb, gre_hlen);
 	memset(&(IPCB(skb)->opt), 0, sizeof(IPCB(skb)->opt));
 	dst_release(skb->dst);
diff -Nru a/net/ipv4/ipip.c b/net/ipv4/ipip.c
--- a/net/ipv4/ipip.c	Fri Oct  3 02:43:29 2003
+++ b/net/ipv4/ipip.c	Fri Oct  3 02:43:29 2003
@@ -596,8 +596,6 @@
 			tunnel->err_count = 0;
 	}
 
-	skb->h.raw = skb->nh.raw;
-
 	/*
 	 * Okay, now see if we can stuff it in the buffer as-is.
 	 */
@@ -619,6 +617,7 @@
 		old_iph = skb->nh.iph;
 	}
 
+	skb->h.raw = skb->nh.raw;
 	skb->nh.raw = skb_push(skb, sizeof(struct iphdr));
 	memset(&(IPCB(skb)->opt), 0, sizeof(IPCB(skb)->opt));
 	dst_release(skb->dst);
diff -Nru a/net/ipv6/sit.c b/net/ipv6/sit.c
--- a/net/ipv6/sit.c	Fri Oct  3 02:43:29 2003
+++ b/net/ipv6/sit.c	Fri Oct  3 02:43:29 2003
@@ -530,8 +530,6 @@
 			tunnel->err_count = 0;
 	}
 
-	skb->h.raw = skb->nh.raw;
-
 	/*
 	 * Okay, now see if we can stuff it in the buffer as-is.
 	 */
@@ -553,6 +551,7 @@
 		iph6 = skb->nh.ipv6h;
 	}
 
+	skb->h.raw = skb->nh.raw;
 	skb->nh.raw = skb_push(skb, sizeof(struct iphdr));
 	memset(&(IPCB(skb)->opt), 0, sizeof(IPCB(skb)->opt));
 	dst_release(skb->dst);


Regards

--
Julian Anastasov <ja@ssi.bg>

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

end of thread, other threads:[~2003-10-07 15:32 UTC | newest]

Thread overview: 7+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2003-10-03  0:00 tunnel xmit and h.raw Julian Anastasov
2003-10-03 14:30 ` David S. Miller
2003-10-03 14:56   ` Julian Anastasov
2003-10-03 15:04     ` David S. Miller
2003-10-03 15:05     ` David S. Miller
2003-10-03 15:49     ` Mika Penttilä
2003-10-07 15:32 ` David S. Miller

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).