From owner-cvs-all@FreeBSD.ORG Wed Jul 19 04:49:45 2006 Return-Path: X-Original-To: cvs-all@FreeBSD.org Delivered-To: cvs-all@FreeBSD.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id F319E16A4DA; Wed, 19 Jul 2006 04:49:44 +0000 (UTC) (envelope-from keramida@ceid.upatras.gr) Received: from igloo.linux.gr (igloo.linux.gr [62.1.205.36]) by mx1.FreeBSD.org (Postfix) with ESMTP id 1877443D46; Wed, 19 Jul 2006 04:49:42 +0000 (GMT) (envelope-from keramida@ceid.upatras.gr) Received: from gothmog.pc (host5.bedc.ondsl.gr [62.103.39.229]) (authenticated bits=128) by igloo.linux.gr (8.13.7/8.13.7/Debian-1) with ESMTP id k6J4nKgW015257 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NOT); Wed, 19 Jul 2006 07:49:28 +0300 Received: from gothmog.pc (gothmog [127.0.0.1]) by gothmog.pc (8.13.7/8.13.7) with ESMTP id k6J4nE3r068703; Wed, 19 Jul 2006 07:49:14 +0300 (EEST) (envelope-from keramida@ceid.upatras.gr) Received: (from giorgos@localhost) by gothmog.pc (8.13.7/8.13.7/Submit) id k6J4nD3e068702; Wed, 19 Jul 2006 07:49:13 +0300 (EEST) (envelope-from keramida@ceid.upatras.gr) Date: Wed, 19 Jul 2006 07:49:13 +0300 From: Giorgos Keramidas To: Bruce Evans Message-ID: <20060719044913.GB64382@gothmog.pc> References: <200606291922.k5TJM5ev007314@repoman.freebsd.org> <20060701003326.GA41947@gothmog.pc> <20060719131841.U41630@delplex.bde.org> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20060719131841.U41630@delplex.bde.org> X-Hellug-MailScanner: Found to be clean X-Hellug-MailScanner-SpamCheck: not spam, SpamAssassin (score=-3.741, required 5, autolearn=not spam, ALL_TRUSTED -1.80, AWL 0.66, BAYES_00 -2.60) X-Hellug-MailScanner-From: keramida@ceid.upatras.gr X-Spam-Status: No Cc: cvs-src@FreeBSD.org, Yar Tikhiy , src-committers@FreeBSD.org, cvs-all@FreeBSD.org Subject: Re: cvs commit: src/sys/net if.c if_atmsubr.c if_stf.c if_tun.c src/sys/netinet if_ether.c ip_divert.c ip_fw2.c src/sys/netinet6 in6.c in6_var.h src/sys/nfsclient bootp_subr.c nfs_diskless.c X-BeenThere: cvs-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: CVS commit messages for the entire tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 19 Jul 2006 04:49:45 -0000 On 2006-07-19 13:32, Bruce Evans wrote: >Long ago, On Sat, 1 Jul 2006, Giorgos Keramidas wrote: >>On 2006-06-29 19:22, Yar Tikhiy wrote: >>> yar 2006-06-29 19:22:05 UTC >>> >>> FreeBSD src repository >>> >>> Modified files: >>> sys/net if.c if_atmsubr.c if_stf.c if_tun.c >>> sys/netinet if_ether.c ip_divert.c ip_fw2.c >>> sys/netinet6 in6.c in6_var.h >>> sys/nfsclient bootp_subr.c nfs_diskless.c >>> Log: >>> There is a consensus that ifaddr.ifa_addr should never be NULL, >>> except in places dealing with ifaddr creation or destruction; and >>> in such special places incomplete ifaddrs should never be linked >>> to system-wide data structures. Therefore we can eliminate all the >>> superfluous checks for "ifa->ifa_addr != NULL" and get ready >>> to the system crashing honestly instead of masking possible bugs. >> >> This is probably silly, but it was the first thing I thought about when >> I saw the NULL checks removed. >> >> Since we assume that ifa->ifa_addr != NULL, does it make sense to add >> KASSERT() calls in the places where we do so? > > No, that would be worse than leaving the checks unchanged. Asserting > that pointers aren't null just re-bloats the code (at least at the > source level) and breaks normal handling of dereferencing of null > pointers. With normal handling, you get a trap that can be restarted > using a debugger, but with assertions (if assertions are enabled) you > get a panic that can't be restarted (modulo the RESTARTABLE_PANICS > option which causes other problems). Subtle, but important difference. Thanks for taking the time to write down the explanation :-)