aboutsummaryrefslogtreecommitdiffstats
path: root/net/ipv6/ip6_gre.c
diff options
context:
space:
mode:
authorCong Wang <xiyou.wangcong@gmail.com>2013-03-09 18:00:39 -0500
committerDavid S. Miller <davem@davemloft.net>2013-03-10 16:53:34 -0400
commite8f72ea4a1380eeca10a551bc8d678e7d4388d42 (patch)
tree617c08e472d8f361de5a4d2198f0321e73285e17 /net/ipv6/ip6_gre.c
parent22c352195ee09dcce9f4f0e2d4cd5f382b90f0fb (diff)
ipv6: introduce ip6tunnel_xmit() helper
Similar to iptunnel_xmit(), group these operations into a helper function. This by the way fixes the missing u64_stats_update_begin() and u64_stats_update_end() for 32 bit arch. Cc: Eric Dumazet <eric.dumazet@gmail.com> Cc: Pravin B Shelar <pshelar@nicira.com> Cc: "David S. Miller" <davem@davemloft.net> Signed-off-by: Cong Wang <xiyou.wangcong@gmail.com> Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'net/ipv6/ip6_gre.c')
-rw-r--r--net/ipv6/ip6_gre.c17
1 files changed, 1 insertions, 16 deletions
diff --git a/net/ipv6/ip6_gre.c b/net/ipv6/ip6_gre.c
index e4efffe2522e..6a6ba73ff265 100644
--- a/net/ipv6/ip6_gre.c
+++ b/net/ipv6/ip6_gre.c
@@ -667,7 +667,6 @@ static netdev_tx_t ip6gre_xmit2(struct sk_buff *skb,
667 struct net_device_stats *stats = &tunnel->dev->stats; 667 struct net_device_stats *stats = &tunnel->dev->stats;
668 int err = -1; 668 int err = -1;
669 u8 proto; 669 u8 proto;
670 int pkt_len;
671 struct sk_buff *new_skb; 670 struct sk_buff *new_skb;
672 671
673 if (dev->type == ARPHRD_ETHER) 672 if (dev->type == ARPHRD_ETHER)
@@ -801,23 +800,9 @@ static netdev_tx_t ip6gre_xmit2(struct sk_buff *skb,
801 } 800 }
802 } 801 }
803 802
804 nf_reset(skb); 803 ip6tunnel_xmit(skb, dev);
805 pkt_len = skb->len;
806 err = ip6_local_out(skb);
807
808 if (net_xmit_eval(err) == 0) {
809 struct pcpu_tstats *tstats = this_cpu_ptr(tunnel->dev->tstats);
810
811 tstats->tx_bytes += pkt_len;
812 tstats->tx_packets++;
813 } else {
814 stats->tx_errors++;
815 stats->tx_aborted_errors++;
816 }
817
818 if (ndst) 804 if (ndst)
819 ip6_tnl_dst_store(tunnel, ndst); 805 ip6_tnl_dst_store(tunnel, ndst);
820
821 return 0; 806 return 0;
822tx_err_link_failure: 807tx_err_link_failure:
823 stats->tx_carrier_errors++; 808 stats->tx_carrier_errors++;