diff options
author | Oliver Hartkopp <socketcan@hartkopp.net> | 2015-06-21 12:50:44 -0400 |
---|---|---|
committer | Greg Kroah-Hartman <gregkh@linuxfoundation.org> | 2015-07-10 12:49:27 -0400 |
commit | 1a2cddd17ebe5e76a796c25e11cdd5518310eabc (patch) | |
tree | b582ac7cd209159054f37f952427cf2264cd5543 /net | |
parent | aa0b8c72f5c1e0208bfafb383b535bdc9d3b2c6b (diff) |
can: fix loss of CAN frames in raw_rcv
commit 36c01245eb8046c16eee6431e7dbfbb302635fa8 upstream.
As reported by Manfred Schlaegl here
http://marc.info/?l=linux-netdev&m=143482089824232&w=2
commit 514ac99c64b "can: fix multiple delivery of a single CAN frame for
overlapping CAN filters" requires the skb->tstamp to be set to check for
identical CAN skbs.
As net timestamping is influenced by several players (netstamp_needed and
netdev_tstamp_prequeue) Manfred missed a proper timestamp which leads to
CAN frame loss.
As skb timestamping became now mandatory for CAN related skbs this patch
makes sure that received CAN skbs always have a proper timestamp set.
Maybe there's a better solution in the future but this patch fixes the
CAN frame loss so far.
Reported-by: Manfred Schlaegl <manfred.schlaegl@gmx.at>
Signed-off-by: Oliver Hartkopp <socketcan@hartkopp.net>
Signed-off-by: Marc Kleine-Budde <mkl@pengutronix.de>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Diffstat (limited to 'net')
-rw-r--r-- | net/can/af_can.c | 6 |
1 files changed, 5 insertions, 1 deletions
diff --git a/net/can/af_can.c b/net/can/af_can.c index 32d710eaf1fc..689c818ed007 100644 --- a/net/can/af_can.c +++ b/net/can/af_can.c | |||
@@ -310,8 +310,12 @@ int can_send(struct sk_buff *skb, int loop) | |||
310 | return err; | 310 | return err; |
311 | } | 311 | } |
312 | 312 | ||
313 | if (newskb) | 313 | if (newskb) { |
314 | if (!(newskb->tstamp.tv64)) | ||
315 | __net_timestamp(newskb); | ||
316 | |||
314 | netif_rx_ni(newskb); | 317 | netif_rx_ni(newskb); |
318 | } | ||
315 | 319 | ||
316 | /* update statistics */ | 320 | /* update statistics */ |
317 | can_stats.tx_frames++; | 321 | can_stats.tx_frames++; |