patch-2.0.8 linux/drivers/net/new_tunnel.c

Next file: linux/drivers/net/ppp.c
Previous file: linux/drivers/net/bsd_comp.c
Back to the patch index
Back to the overall index

diff -u --recursive --new-file v2.0.7/linux/drivers/net/new_tunnel.c linux/drivers/net/new_tunnel.c
@@ -233,8 +233,9 @@
 printk("Room left at tail: %d\n", skb_tailroom(skb));
 printk("Required room: %d, Tunnel hlen: %d\n", max_headroom, TUNL_HLEN);
 #endif
-	if (skb_headroom(skb) >= max_headroom) {
+	if (skb_headroom(skb) >= max_headroom && skb->free) {
 		skb->h.iph = (struct iphdr *) skb_push(skb, tunnel_hlen);
+		skb_device_unlock(skb);
 	} else {
 		struct sk_buff *new_skb;
 
@@ -289,7 +290,7 @@
 	iph->tot_len		=	htons(skb->len);
 	iph->id			=	htons(ip_id_count++);	/* Race condition here? */
 	ip_send_check(iph);
-	skb->ip_hdr 		= skb->h.iph;
+	skb->ip_hdr 		=	skb->h.iph;
 	skb->protocol		=	htons(ETH_P_IP);
 #ifdef TUNNEL_DEBUG
 	printk("New IP Header....\n");
@@ -303,7 +304,7 @@
 	 */
 
 #ifdef CONFIG_IP_FORWARD
-	if (ip_forward(skb, dev, 0, target))
+	if (ip_forward(skb, dev, IPFWD_NOTTLDEC, target))
 #endif
 		kfree_skb(skb, FREE_WRITE);
 

FUNET's LINUX-ADM group, linux-adm@nic.funet.fi
TCL-scripts by Sam Shen, slshen@lbl.gov