From: Xin Long <lucien.xin@gmail.com>
To: network dev <netdev@vger.kernel.org>
Cc: davem@davemloft.net, Jon Maloy <jon.maloy@ericsson.com>,
Ying Xue <ying.xue@windriver.com>,
tipc-discussion@lists.sourceforge.net,
Marcelo Ricardo Leitner <marcelo.leitner@gmail.com>,
Neil Horman <nhorman@tuxdriver.com>,
Su Yanjun <suyj.fnst@cn.fujitsu.com>,
David Ahern <dsahern@gmail.com>,
syzkaller-bugs@googlegroups.com,
Dmitry Vyukov <dvyukov@google.com>,
Pravin B Shelar <pshelar@nicira.com>
Subject: [PATCH net 2/3] ip6_tunnel: allow not to count pkts on tstats by passing dev as NULL
Date: Mon, 17 Jun 2019 21:34:14 +0800 [thread overview]
Message-ID: <92d40ac2577045f09a1d3ee79c7fed73fbdbde1a.1560778340.git.lucien.xin@gmail.com> (raw)
In-Reply-To: <89113721df2e1ea6f2ea9ecffe4024588f224dc3.1560778340.git.lucien.xin@gmail.com>
In-Reply-To: <cover.1560778340.git.lucien.xin@gmail.com>
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>
---
include/net/ip6_tunnel.h | 9 ++++++---
1 file changed, 6 insertions(+), 3 deletions(-)
diff --git a/include/net/ip6_tunnel.h b/include/net/ip6_tunnel.h
index 69b4bcf..028eaea 100644
--- a/include/net/ip6_tunnel.h
+++ b/include/net/ip6_tunnel.h
@@ -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
--
2.1.0
next prev parent reply other threads:[~2019-06-17 13:34 UTC|newest]
Thread overview: 5+ messages / expand[flat|nested] mbox.gz Atom feed top
2019-06-17 13:34 [PATCH net 0/3] net: fix quite a few dst_cache crashes reported by syzbot Xin Long
2019-06-17 13:34 ` [PATCH net 1/3] ip_tunnel: allow not to count pkts on tstats by setting skb's dev to NULL Xin Long
2019-06-17 13:34 ` Xin Long [this message]
2019-06-17 13:34 ` [PATCH net 3/3] tipc: pass tunnel dev as NULL to udp_tunnel(6)_xmit_skb Xin Long
2019-06-19 0:49 ` [PATCH net 0/3] net: fix quite a few dst_cache crashes reported by syzbot David Miller
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=92d40ac2577045f09a1d3ee79c7fed73fbdbde1a.1560778340.git.lucien.xin@gmail.com \
--to=lucien.xin@gmail.com \
--cc=davem@davemloft.net \
--cc=dsahern@gmail.com \
--cc=dvyukov@google.com \
--cc=jon.maloy@ericsson.com \
--cc=marcelo.leitner@gmail.com \
--cc=netdev@vger.kernel.org \
--cc=nhorman@tuxdriver.com \
--cc=pshelar@nicira.com \
--cc=suyj.fnst@cn.fujitsu.com \
--cc=syzkaller-bugs@googlegroups.com \
--cc=tipc-discussion@lists.sourceforge.net \
--cc=ying.xue@windriver.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).