Skip to content

Commit

Permalink
ip6_tunnel: allow not to count pkts on tstats by passing dev as NULL
Browse files Browse the repository at this point in the history
A similar fix to Patch "ip_tunnel: allow not to count pkts on tstats by
setting skb's dev to NULL" is also needed by ip6_tunnel.

Signed-off-by: Xin Long <lucien.xin@gmail.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
  • Loading branch information
Xin Long authored and David S. Miller committed Jun 19, 2019
1 parent 5684abf commit 6f6a862
Showing 1 changed file with 6 additions and 3 deletions.
9 changes: 6 additions & 3 deletions include/net/ip6_tunnel.h
Original file line number Diff line number Diff line change
Expand Up @@ -158,9 +158,12 @@ static inline void ip6tunnel_xmit(struct sock *sk, struct sk_buff *skb,
memset(skb->cb, 0, sizeof(struct inet6_skb_parm));
pkt_len = skb->len - skb_inner_network_offset(skb);
err = ip6_local_out(dev_net(skb_dst(skb)->dev), sk, skb);
if (unlikely(net_xmit_eval(err)))
pkt_len = -1;
iptunnel_xmit_stats(dev, pkt_len);

if (dev) {
if (unlikely(net_xmit_eval(err)))
pkt_len = -1;
iptunnel_xmit_stats(dev, pkt_len);
}
}
#endif
#endif

0 comments on commit 6f6a862

Please sign in to comment.