patch-2.4.0-test6 linux/net/ipv4/ip_gre.c

Next file: linux/net/ipv4/ip_options.c
Previous file: linux/net/ipv4/igmp.c
Back to the patch index
Back to the overall index

diff -u --recursive --new-file v2.4.0-test5/linux/net/ipv4/ip_gre.c linux/net/ipv4/ip_gre.c
@@ -668,7 +668,6 @@
 	int    gre_hlen;
 	u32    dst;
 	int    mtu;
-	int    err;
 
 	if (tunnel->recursion++) {
 		tunnel->stat.collisions++;
@@ -856,26 +855,12 @@
 		}
 	}
 
-	iph->tot_len		=	htons(skb->len);
-	ip_select_ident(iph, &rt->u.dst);
-	ip_send_check(iph);
-
 #ifdef CONFIG_NETFILTER
 	nf_conntrack_put(skb->nfct);
 	skb->nfct = NULL;
 #endif
 
-	err = NF_HOOK(PF_INET, NF_IP_LOCAL_OUT, skb, NULL, rt->u.dst.dev,
-		do_ip_send);
-	if(err < 0) {
-		if(net_ratelimit())
-			printk(KERN_ERR "ipgre_tunnel_xmit: ip_send() failed, err=%d\n", -err);
-		skb = NULL;
-		goto tx_error;
-	}
-
-	stats->tx_bytes += skb->len;
-	stats->tx_packets++;
+	IPTUNNEL_XMIT();
 	tunnel->recursion--;
 	return 0;
 
@@ -884,8 +869,7 @@
 
 tx_error:
 	stats->tx_errors++;
-	if(skb)
-		dev_kfree_skb(skb);
+	dev_kfree_skb(skb);
 	tunnel->recursion--;
 	return 0;
 }

FUNET's LINUX-ADM group, linux-adm@nic.funet.fi
TCL-scripts by Sam Shen (who was at: slshen@lbl.gov)