patch-2.1.22 linux/drivers/net/tunnel.c

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

diff -u --recursive --new-file v2.1.21/linux/drivers/net/tunnel.c linux/drivers/net/tunnel.c
@@ -122,7 +122,6 @@
 {
 	struct enet_statistics *stats;		/* This device's statistics */
 	struct rtable *rt;     			/* Route to the other host */
-	struct hh_cache *hh;
 	struct device *tdev;			/* Device to other host */
 	struct iphdr  *iph;			/* Our new IP header */
 	int    max_headroom;			/* The extra header space needed */
@@ -143,7 +142,6 @@
 		return 0;
 	}
 	tdev = rt->u.dst.dev;
-	hh = rt->u.dst.hh;
 
 	if (tdev->type == ARPHRD_TUNNEL) { 
 		/* Tunnel to tunnel?  -- I don't think so. */
@@ -161,7 +159,7 @@
 	 */
 	max_headroom = (((tdev->hard_header_len+15)&~15)+tunnel_hlen);
 
-	if (skb_headroom(skb) < max_headroom || skb->users != 1) {
+	if (skb_headroom(skb) < max_headroom || skb_shared(skb)) {
 		struct sk_buff *new_skb = skb_realloc_headroom(skb, max_headroom);
 		if (!new_skb) {
 			ip_rt_put(rt);

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