slip.c is not jiffy wrap proof in 2.2 and 2.3

From: Oleg Drokin (green@ccssu.crimea.ua)
Date: Wed Mar 01 2000 - 11:08:33 EST


Hello!

  I found that drivers/net/slip.c in 2.2 and in 2.3 is not jiffy wrap proof.
  it has this code 'if (jiffies - dev->trans_start < 20 * HZ) {'
  It may be even ok in 2.2, as a lot of net drivers use almost the same
  code, but I see that in 2.3 nobody except slip.c uses that, so
  here is the patch.
  It applies to 2.2 and to 2.3 (with some fuzz, thou)

--- slip.c.orig Wed Mar 1 17:53:16 2000
+++ slip.c Wed Mar 1 18:00:04 2000
@@ -502,7 +502,7 @@
                  * 14 Oct 1994 Dmitry Gorodchanin.
                  */
 #ifdef SL_CHECK_TRANSMIT
- if (jiffies - dev->trans_start < 20 * HZ) {
+ if (time_after(dev->trans_start + 20 * HZ, jiffies) ) {
                         /* 20 sec timeout not reached */
                         return 1;
                 }

Bye,
    Oleg

-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.rutgers.edu
Please read the FAQ at http://www.tux.org/lkml/



This archive was generated by hypermail 2b29 : Tue Mar 07 2000 - 21:00:09 EST