From owner-freebsd-questions Sun Sep 22 11:20:10 1996 Return-Path: owner-questions Received: (from root@localhost) by freefall.freebsd.org (8.7.5/8.7.3) id LAA07450 for questions-outgoing; Sun, 22 Sep 1996 11:20:10 -0700 (PDT) Received: from al.imforei.apana.org.au (pjchilds@al.imforei.apana.org.au [202.12.89.41]) by freefall.freebsd.org (8.7.5/8.7.3) with ESMTP id LAA07408 for ; Sun, 22 Sep 1996 11:20:05 -0700 (PDT) Received: (from pjchilds@localhost) by al.imforei.apana.org.au (8.7.6/8.7.3) id DAA09508; Mon, 23 Sep 1996 03:49:56 +0930 (CST) Date: Mon, 23 Sep 1996 03:49:56 +0930 (CST) From: Peter Childs Message-Id: <199609221819.DAA09508@al.imforei.apana.org.au> To: brett@lariat.org (Brett Glass), freebsd-questions@freebsd.org Subject: Re: systat/netstat utilities buggy? X-Newsreader: TIN [version 1.2 PL2] Sender: owner-questions@freebsd.org X-Loop: FreeBSD.org Precedence: bulk : 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!