]> rtime.felk.cvut.cz Git - linux-lin.git/blobdiff - sllin/sllin.c
sllin: Evaluate message upon break only if received at least a LIN ID
[linux-lin.git] / sllin / sllin.c
index 61c81348faa9a8e95a18db04b8c3f82c4e879815..8d7ad6975ab08873245b423bd826552db438cae4 100644 (file)
@@ -716,10 +716,12 @@ static void sllin_slave_receive_buf(struct tty_struct *tty,
                if (fp && *fp++) {
                        /*
                         * If we don't know the length of the current message
                if (fp && *fp++) {
                        /*
                         * If we don't know the length of the current message
-                        * we received the break of the next message.
-                        * Evaluate the previous one before continuing
+                        * and received at least the LIN ID, we received here
+                        * the break of the next message.
+                        * Evaluate the previous one before continuing.
                         */
                         */
-                       if (sl->rx_len_unknown == true)
+                       if ((sl->rx_len_unknown == true) &&
+                               (sl->rx_cnt >= SLLIN_BUFF_ID))
                        {
                                hrtimer_cancel(&sl->rx_timer);
                                sllin_slave_finish_rx_msg(sl);
                        {
                                hrtimer_cancel(&sl->rx_timer);
                                sllin_slave_finish_rx_msg(sl);