From owner-freebsd-net Sun Sep 23 2:54: 2 2001 Delivered-To: freebsd-net@freebsd.org Received: from amsfep14-int.chello.nl (amsfep14-int.chello.nl [213.46.243.21]) by hub.freebsd.org (Postfix) with ESMTP id 051E337B41D for ; Sun, 23 Sep 2001 02:53:58 -0700 (PDT) Received: from daemon.chronias.ninth-circle.org ([62.163.96.180]) by amsfep14-int.chello.nl (InterMail vM.5.01.03.06 201-253-122-118-106-20010523) with ESMTP id <20010923094958.RCO25701.amsfep14-int.chello.nl@daemon.chronias.ninth-circle.org>; Sun, 23 Sep 2001 11:49:58 +0200 Received: (from asmodai@localhost) by daemon.chronias.ninth-circle.org (8.11.3/8.11.3) id f8N9l8R25554; Sun, 23 Sep 2001 11:47:08 +0200 (CEST) (envelope-from asmodai) Date: Sun, 23 Sep 2001 11:47:08 +0200 From: Jeroen Ruigrok/Asmodai To: "Matthew N. Dodd" Cc: freebsd-net@freebsd.org Subject: Re: review request. Message-ID: <20010923114707.H4995@daemon.ninth-circle.org> References: Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: User-Agent: Mutt/1.3.19i Organisation: Ninth-Circle Enterprises Sender: owner-freebsd-net@FreeBSD.ORG Precedence: bulk List-ID: List-Archive: (Web Archive) List-Help: (List Instructions) List-Subscribe: List-Unsubscribe: X-Loop: FreeBSD.org -On [20010923 11:38], Matthew N. Dodd (winter@jurai.net) wrote: >sys/net/if.c and bpf.c have problems with if_detach() and >bpfdetach() when they are called with a struct ifnet that has not had >if_attach() and bpfattach() called on it. Null pointer reference -> >*boom* etc. > >This patch fixes the test already present in bpfdetach() and adds a test >to if_detach(). Patch looks sane to me. Basically it is a combination of asserting and defensive programming, which never hurts. -- Jeroen Ruigrok van der Werven/Asmodai asmodai@[wxs.nl|freebsd.org|xmach.org] Documentation nutter/C-rated Coder, finger asmodai@ninth-circle.dnsalias.net http://www.freebsd.org/doc/en_US.ISO8859-1/books/developers-handbook/ At the End of the Rainbow, with Gold in our hands... To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-net" in the body of the message