Skip site navigation (1)Skip section navigation (2)
Date:      Mon, 23 Sep 1996 03:49:56 +0930 (CST)
From:      Peter Childs <pjchilds@imforei.apana.org.au>
To:        brett@lariat.org (Brett Glass), freebsd-questions@freebsd.org
Subject:   Re: systat/netstat utilities buggy?
Message-ID:  <199609221819.DAA09508@al.imforei.apana.org.au>

next in thread | raw e-mail | index | archive | help
: I would be VERY surprised, though, if a programmer were careless enough to
: traverse a linked list whose links could potentially change without locking
: resources -- or deferring insertions and deletions until after a traversal.
: Doing nameserver lookups in the MIDDLE of the traversal is EXTREMELY poor
: practice, since it maximizes the danger of inconsistencies even if the list
: is traversed safely. Do you have the code to FreeBSD's netstat? (I don't
: have room for the source tree here.) Is it really coded this badly?

 Grin.. better lock the kernel from opening/closing sockets during
 a user-land program run?  Nah.. don't think so :)  I'm not sure
 how netstat works, but a quick look at the code and you should
 be able to identify the problem.

 You might need to do a quick dump copy of the table to local
 land before trying to do any action (ie. the current system might
 be trying to do hostname resolution whilst traversing the
 list)

 Good luck and don't forget to submit your diffs :)

 Peter

--
 Peter Childs  ---  http://www.imforei.apana.org.au/~pjchilds
  Finger pjchilds@al.imforei.apana.org.au for public PGP key
         Drag me, drop me, treat me like an object!



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?199609221819.DAA09508>