home *** CD-ROM | disk | FTP | other *** search
/ NetNews Usenet Archive 1992 #19 / NN_1992_19.iso / spool / comp / unix / bsd / 4874 < prev    next >
Encoding:
Internet Message Format  |  1992-08-30  |  3.7 KB

  1. Path: sparky!uunet!ferkel.ucsb.edu!taco!gatech!bloom-beacon!eru.mt.luth.se!lunic!sunic!dkuug!flshub!phk
  2. From: phk@data.fls.dk (Poul-Henning Kamp)
  3. Newsgroups: comp.unix.bsd
  4. Subject: PATCH to stabilize SLIP on lossy lines &&/|| UARTS
  5. Keywords: PATCH
  6. Message-ID: <1992Aug30.112824.28717@data.fls.dk>
  7. Date: 30 Aug 92 11:28:24 GMT
  8. Organization: FLS Data A/S, Valby, Copenhagen, Denmark.
  9. Lines: 123
  10.  
  11. BUG FINDER INFORMATION
  12.  
  13. NAME:        Poul-Henning Kamp
  14. TITLE:        Resident UNIX Guru & Network architect
  15. FIRM:        FLS Data A/S
  16. ADDRESS:    Ramsingsvej 7, DK-2500 Valby
  17. COUNTRY:    Denmark
  18. PHONE:        (+45) 36 18 12 35
  19. FAX:        (+45) 36 18 12 18
  20. EMAIL:        phk@data.fls.dk
  21.  
  22. Here is a patch to clean up the interface between the tty-drivers, in
  23. particular the com driver, and the sl# interfaces, this is not a work-around
  24. but a genuine bug-fix.
  25.  
  26. Symptoms: after a number of "com#: silo overflow" SLIP ceases to work.
  27.  
  28. Overview of the problem:  the slip interface will disregard any notice
  29. from the tty-driver on problems (parity errors, framing errors or overruns),
  30. which basicly means the one might as well throw the packet away right away.
  31. Also overrun in the packetizing will go relatively unnotized.
  32.  
  33. The com-driver on the other hand does nothing to alert the slip interface
  34. on dropped characters. (Which is a serious problem with non-FIFO UART's)
  35.  
  36. All the crippled packets produced by these bugs really triggers of some
  37. sanity-checks in /sys/netinet/{ip,tcp}_input.c which does not free the mbuf
  38. but rather leave the mbuf intact, and unusable for the future, thus starving
  39. on mbufs will occur later.
  40.  
  41. The problem is in ip_input.c a lot of "goto next" should be "goto bad", 
  42. and a couple of returns in tcp_input.c might need to be prefixed
  43. with m_free()'s. 
  44.  
  45. I will investigate this carefully now and issue a patch later.
  46.  
  47. Hacking into to night to Glenn Gould & Bach's French Suite's...
  48.  
  49. Poul-Henning Kamp
  50.  
  51.  
  52. cd /
  53. patch -p < this_article
  54.  
  55. *** /sys/i386/isa/com.c    Sun Jul  5 13:55:12 1992
  56. --- sys.386bsd/i386/isa/com.c    Sat Aug 29 14:28:53 1992
  57. ***************
  58. *** 370,374 ****
  59. --- 370,377 ----
  60.           c |= TTY_PE;
  61.       else if (stat & LSR_OE)
  62. +         {
  63. +         c |= TTY_PE;  /* Ought to have it's own define... */
  64.           log(LOG_WARNING, "com%d: silo overflow\n", unit);
  65. +         }
  66.       (*linesw[tp->t_line].l_rint)(c, tp);
  67.   }
  68. *** /sys/net/if_sl.c    Wed Jun  3 02:46:02 1992
  69. --- sys.386bsd/net/if_sl.c    Sat Aug 29 14:25:56 1992
  70. ***************
  71. *** 624,633 ****
  72.       if (sc == NULL)
  73.           return;
  74. !     if (!(tp->t_state&TS_CARR_ON))    /* XXX */
  75.           return;
  76.   
  77.       ++sc->sc_bytesrcvd;
  78.       ++sc->sc_if.if_ibytes;
  79. -     c &= 0xff;            /* XXX */
  80.   
  81.   #ifdef ABT_ESC
  82. --- 624,635 ----
  83.       if (sc == NULL)
  84.           return;
  85. !     if (c > 255 || !(tp->t_state&TS_CARR_ON))    /* XXX */
  86. !         {
  87. !         sc->sc_flags |= SC_ERROR;
  88.           return;
  89. +         }
  90.   
  91.       ++sc->sc_bytesrcvd;
  92.       ++sc->sc_if.if_ibytes;
  93.   
  94.   #ifdef ABT_ESC
  95. ***************
  96. *** 675,679 ****
  97. --- 677,687 ----
  98.   
  99.       case FRAME_END:
  100. +         if(sc->sc_flags & SC_ERROR)
  101. +             {
  102. +             sc->sc_flags &= ~SC_ERROR;
  103. +             goto newpack;
  104. +             }
  105.           len = sc->sc_mp - sc->sc_buf;
  106.           if (len < 3)
  107.               /* less than min length packet - ignore */
  108. ***************
  109. *** 731,734 ****
  110. --- 739,743 ----
  111.           return;
  112.       }
  113. +     sc->sc_flags |= SC_ERROR;
  114.   error:
  115.       sc->sc_if.if_ierrors++;
  116. *** /sys/net/if_slvar.h    Tue Dec 24 14:24:10 1991
  117. --- sys.386bsd/net/if_slvar.h    Sat Aug 29 14:20:54 1992
  118. ***************
  119. *** 66,69 ****
  120. --- 66,70 ----
  121.   #define    SC_AUTOCOMP    0x0008        /* auto-enable TCP compression */
  122.   /* internal flags (should be separate) */
  123. + #define    SC_ERROR    0x08000        /* had an input error */
  124.   #define    SC_ABORT    0x10000        /* have been sent an abort request */
  125.  
  126.  
  127.  
  128. -- 
  129. phk@data.fls.dk          || If you can't join 'em -- beat 'em !
  130. Poul-Henning Kamp      ||            the Danish foreign minister
  131. FLS DATA A/S          ||
  132. Phone: (+45) 36 18 12 35  ||
  133.