diff options
author | Oliver Hartkopp <socketcan@hartkopp.net> | 2015-06-21 18:50:44 +0200 |
---|---|---|
committer | Sasha Levin <sasha.levin@oracle.com> | 2015-07-12 12:50:46 -0400 |
commit | c215cf258214858a5a6c3e63cd7ee78b92d210b2 (patch) | |
tree | 02d83a593f5732d318fde7cd0f7f007faafad493 /net | |
parent | e47534f4c52e9e18445d24c04b5c3366278589ee (diff) |
can: fix loss of CAN frames in raw_rcv
[ Upstream commit 36c01245eb8046c16eee6431e7dbfbb302635fa8 ]
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>
Cc: linux-stable <stable@vger.kernel.org>
Signed-off-by: Marc Kleine-Budde <mkl@pengutronix.de>
Signed-off-by: Sasha Levin <sasha.levin@oracle.com>
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 d6030d6949df..9a3244941a5c 100644 --- a/net/can/af_can.c +++ b/net/can/af_can.c @@ -313,8 +313,12 @@ int can_send(struct sk_buff *skb, int loop) return err; } - if (newskb) + if (newskb) { + if (!(newskb->tstamp.tv64)) + __net_timestamp(newskb); + netif_rx_ni(newskb); + } /* update statistics */ can_stats.tx_frames++; |