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>
Esse commit está contido em:
@@ -667,7 +667,6 @@ static netdev_tx_t ip6gre_xmit2(struct sk_buff *skb,
|
||||
struct net_device_stats *stats = &tunnel->dev->stats;
|
||||
int err = -1;
|
||||
u8 proto;
|
||||
int pkt_len;
|
||||
struct sk_buff *new_skb;
|
||||
|
||||
if (dev->type == ARPHRD_ETHER)
|
||||
@@ -801,23 +800,9 @@ static netdev_tx_t ip6gre_xmit2(struct sk_buff *skb,
|
||||
}
|
||||
}
|
||||
|
||||
nf_reset(skb);
|
||||
pkt_len = skb->len;
|
||||
err = ip6_local_out(skb);
|
||||
|
||||
if (net_xmit_eval(err) == 0) {
|
||||
struct pcpu_tstats *tstats = this_cpu_ptr(tunnel->dev->tstats);
|
||||
|
||||
tstats->tx_bytes += pkt_len;
|
||||
tstats->tx_packets++;
|
||||
} else {
|
||||
stats->tx_errors++;
|
||||
stats->tx_aborted_errors++;
|
||||
}
|
||||
|
||||
ip6tunnel_xmit(skb, dev);
|
||||
if (ndst)
|
||||
ip6_tnl_dst_store(tunnel, ndst);
|
||||
|
||||
return 0;
|
||||
tx_err_link_failure:
|
||||
stats->tx_carrier_errors++;
|
||||
|
Referência em uma nova issue
Block a user