]> git.karo-electronics.de Git - karo-tx-linux.git/blobdiff - net/ipv4/ip_tunnel_core.c
ip_tunnel: Move stats update to iptunnel_xmit()
[karo-tx-linux.git] / net / ipv4 / ip_tunnel_core.c
index 84dce6a92f93bec35158b392477c536d6f2f1529..eb52ce950c27b7f4ed06f349f1655a2e38968d72 100644 (file)
@@ -24,7 +24,6 @@
 #include <linux/netdevice.h>
 #include <linux/in.h>
 #include <linux/if_arp.h>
-#include <linux/mroute.h>
 #include <linux/init.h>
 #include <linux/in6.h>
 #include <linux/inetdevice.h>
 #include <net/rtnetlink.h>
 #include <net/dst_metadata.h>
 
-int iptunnel_xmit(struct sock *sk, struct rtable *rt, struct sk_buff *skb,
-                 __be32 src, __be32 dst, __u8 proto,
-                 __u8 tos, __u8 ttl, __be16 df, bool xnet)
+void iptunnel_xmit(struct sock *sk, struct rtable *rt, struct sk_buff *skb,
+                  __be32 src, __be32 dst, __u8 proto,
+                  __u8 tos, __u8 ttl, __be16 df, bool xnet)
 {
        int pkt_len = skb->len - skb_inner_network_offset(skb);
+       struct net *net = dev_net(rt->dst.dev);
+       struct net_device *dev = skb->dev;
        struct iphdr *iph;
        int err;
 
@@ -76,13 +77,12 @@ int iptunnel_xmit(struct sock *sk, struct rtable *rt, struct sk_buff *skb,
        iph->daddr      =       dst;
        iph->saddr      =       src;
        iph->ttl        =       ttl;
-       __ip_select_ident(dev_net(rt->dst.dev), iph,
-                         skb_shinfo(skb)->gso_segs ?: 1);
+       __ip_select_ident(net, iph, skb_shinfo(skb)->gso_segs ?: 1);
 
-       err = ip_local_out_sk(sk, skb);
+       err = ip_local_out(net, sk, skb);
        if (unlikely(net_xmit_eval(err)))
                pkt_len = 0;
-       return pkt_len;
+       iptunnel_xmit_stats(dev, pkt_len);
 }
 EXPORT_SYMBOL_GPL(iptunnel_xmit);