cvs commit: src/sys/net route.c

Bjoern A. Zeeb bz at FreeBSD.org
Thu May 4 18:33:38 UTC 2006


bz          2006-05-04 18:33:37 UTC

  FreeBSD src repository

  Modified files:
    sys/net              route.c 
  Log:
  In rtrequest and rtinit check for sa_len != 0 for the given
  destination. These checks are needed so we do not install
  a route looking like this:
  (0)                192.0.2.200        UH       tun0 =>
  
  When removing this route  the kernel will start to walk
  the address space which looks like a hang on 64bit platforms
  because it'll take ages while on 32bit you should see a panic
  when kernel debugging options are turned on.
  
  The problem is in rtrequest1:
          if (netmask) {
                  rt_maskedcopy(dst, ndst, netmask);
          } else
                  bcopy(dst, ndst, dst->sa_len);
  
  In both cases the len might be 0 if the application forgot to
  set it.  If so ndst will be all-zero  leading to above
  mentioned strange routes.
  
  This is an application error but we must not fail/hang/panic
  because of this.
  
  Looks ok:       gnn
  No objections:  net@ (silence)
  MFC after:      8 weeks
  
  Revision  Changes    Path
  1.115     +6 -0      src/sys/net/route.c


More information about the cvs-src mailing list