home *** CD-ROM | disk | FTP | other *** search
/ NetNews Usenet Archive 1992 #30 / NN_1992_30.iso / spool / comp / unix / bsd / 10167 < prev    next >
Encoding:
Internet Message Format  |  1992-12-13  |  2.3 KB

  1. Path: sparky!uunet!munnari.oz.au!ariel.ucs.unimelb.EDU.AU!werple.apana.org.au!news
  2. From: andrew@werple.apana.org.au (Andrew Herbert)
  3. Newsgroups: comp.unix.bsd
  4. Subject: [386bsd] ICMP redirect handling panic - FIX
  5. Date: 14 Dec 1992 13:30:41 +1100
  6. Organization: werple public-access unix, Melbourne
  7. Lines: 65
  8. Message-ID: <1ggrkhINN67h@werple.apana.org.au>
  9. NNTP-Posting-Host: werple.apana.org.au
  10.  
  11. Running a 386bsd machine attached to a router box (running the freely available
  12. pcroute software) handling modem-based SLIP links can panic 386bsd if a link
  13. fails while in use.  This is due to pcroute sending ICMP redirects to say that
  14. the current route is no longer valid.
  15.  
  16. The fact that the ENETUNREACH branch (look in the source for rtredirect()),
  17. the cause of the panic, is taken at all makes me somewhat dubious as to whether
  18. pcroute is doing the right thing.  printf()s indicated that the redirects were
  19. coming from the router's slip interface that had just died, rather than the
  20. ethernet interface as is (reasonably) expected by 386bsd.  But in any case, it
  21. certainly uncovered a 386bsd bug.
  22.  
  23. Few people are likely to have run into this particular problem, but for those
  24. that have (and for people that don't like the thought of running broken
  25. kernels :-) the fix follows...
  26.  
  27. enjoy,
  28. Andrew Herbert
  29.  
  30. *** /sys/net/route.c.unhacked    Sat Dec 12 18:06:18 1992
  31. --- /sys/net/route.c    Mon Dec 14 13:06:07 1992
  32. ***************
  33. *** 31,36 ****
  34. --- 31,40 ----
  35.    * SUCH DAMAGE.
  36.    *
  37.    *    @(#)route.c    7.22 (Berkeley) 6/27/91
  38. +  *
  39. +  * PATCHES
  40. +  * -------
  41. +  * rtredirect() fix    12 Dec 92    andrew@werple.apana.org.au
  42.    */
  43.   #include "param.h"
  44.   #include "systm.h"
  45. ***************
  46. *** 150,156 ****
  47.       int flags;
  48.       struct rtentry **rtp;
  49.   {
  50. !     register struct rtentry *rt;
  51.       int error = 0;
  52.       short *stat = 0;
  53.   
  54. --- 154,160 ----
  55.       int flags;
  56.       struct rtentry **rtp;
  57.   {
  58. !     register struct rtentry *rt = 0;   /* andrew@werple - 12 Dec 92  XXX */
  59.       int error = 0;
  60.       short *stat = 0;
  61.   
  62. ***************
  63. *** 170,175 ****
  64. --- 174,183 ----
  65.       if (!(flags & RTF_DONE) && rt && !equal(src, rt->rt_gateway))
  66.           error = EINVAL;
  67.       else if (ifa_ifwithaddr(gateway))
  68. + /*
  69. +  * XXX - shouldn't this be testing whether (ifa_ifwithaddr(gateway) == 0) ???
  70. +  * i.e. gateway can't be reached from any interface - andrew@werple, 12 Dec 92
  71. +  */
  72.           error = EHOSTUNREACH;
  73.       if (error)
  74.           goto done;
  75.  
  76.