diff options
author | Cong Wang <xiyou.wangcong@gmail.com> | 2013-03-09 18:00:39 -0500 |
---|---|---|
committer | David S. Miller <davem@davemloft.net> | 2013-03-10 16:53:34 -0400 |
commit | e8f72ea4a1380eeca10a551bc8d678e7d4388d42 (patch) | |
tree | 617c08e472d8f361de5a4d2198f0321e73285e17 /net/ipv6/ip6_tunnel.c | |
parent | 22c352195ee09dcce9f4f0e2d4cd5f382b90f0fb (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_tunnel.c')
-rw-r--r-- | net/ipv6/ip6_tunnel.c | 15 |
1 files changed, 1 insertions, 14 deletions
diff --git a/net/ipv6/ip6_tunnel.c b/net/ipv6/ip6_tunnel.c index fff83cbc197f..bef3fedfdc56 100644 --- a/net/ipv6/ip6_tunnel.c +++ b/net/ipv6/ip6_tunnel.c | |||
@@ -955,7 +955,6 @@ static int ip6_tnl_xmit2(struct sk_buff *skb, | |||
955 | unsigned int max_headroom = sizeof(struct ipv6hdr); | 955 | unsigned int max_headroom = sizeof(struct ipv6hdr); |
956 | u8 proto; | 956 | u8 proto; |
957 | int err = -1; | 957 | int err = -1; |
958 | int pkt_len; | ||
959 | 958 | ||
960 | if (!fl6->flowi6_mark) | 959 | if (!fl6->flowi6_mark) |
961 | dst = ip6_tnl_dst_check(t); | 960 | dst = ip6_tnl_dst_check(t); |
@@ -1035,19 +1034,7 @@ static int ip6_tnl_xmit2(struct sk_buff *skb, | |||
1035 | ipv6h->nexthdr = proto; | 1034 | ipv6h->nexthdr = proto; |
1036 | ipv6h->saddr = fl6->saddr; | 1035 | ipv6h->saddr = fl6->saddr; |
1037 | ipv6h->daddr = fl6->daddr; | 1036 | ipv6h->daddr = fl6->daddr; |
1038 | nf_reset(skb); | 1037 | ip6tunnel_xmit(skb, dev); |
1039 | pkt_len = skb->len; | ||
1040 | err = ip6_local_out(skb); | ||
1041 | |||
1042 | if (net_xmit_eval(err) == 0) { | ||
1043 | struct pcpu_tstats *tstats = this_cpu_ptr(t->dev->tstats); | ||
1044 | |||
1045 | tstats->tx_bytes += pkt_len; | ||
1046 | tstats->tx_packets++; | ||
1047 | } else { | ||
1048 | stats->tx_errors++; | ||
1049 | stats->tx_aborted_errors++; | ||
1050 | } | ||
1051 | if (ndst) | 1038 | if (ndst) |
1052 | ip6_tnl_dst_store(t, ndst); | 1039 | ip6_tnl_dst_store(t, ndst); |
1053 | return 0; | 1040 | return 0; |