From owner-svn-src-stable-8@FreeBSD.ORG Fri Aug 6 11:49:52 2010 Return-Path: Delivered-To: svn-src-stable-8@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 98682106566B; Fri, 6 Aug 2010 11:49:52 +0000 (UTC) (envelope-from bz@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 6BDB48FC17; Fri, 6 Aug 2010 11:49:52 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id o76BnqhK005589; Fri, 6 Aug 2010 11:49:52 GMT (envelope-from bz@svn.freebsd.org) Received: (from bz@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o76Bnqcr005586; Fri, 6 Aug 2010 11:49:52 GMT (envelope-from bz@svn.freebsd.org) Message-Id: <201008061149.o76Bnqcr005586@svn.freebsd.org> From: "Bjoern A. Zeeb" Date: Fri, 6 Aug 2010 11:49:52 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-8@freebsd.org X-SVN-Group: stable-8 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r210928 - in stable/8/sys: netinet netinet6 X-BeenThere: svn-src-stable-8@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for only the 8-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 06 Aug 2010 11:49:52 -0000 Author: bz Date: Fri Aug 6 11:49:52 2010 New Revision: 210928 URL: http://svn.freebsd.org/changeset/base/210928 Log: MFC r210703: Document the mandatory argument to the arptimer() and nd6_llinfo_timer() functions with a KASSERT(). Note: there is no need to return after panic. In the legacy IP case, only assign the arg after the check, in the IPv6 case, remove the extra checks for the table and interface as they have to be there unless we freed and forgot to cancel the timer. It doesn't matter anyway as we would panic on the NULL pointer deref immediately and the bug is elsewhere. This unifies the code of both address families to some extend. Reviewed by: rwatson Modified: stable/8/sys/netinet/if_ether.c stable/8/sys/netinet6/nd6.c Directory Properties: stable/8/sys/ (props changed) stable/8/sys/amd64/include/xen/ (props changed) stable/8/sys/cam/ (props changed) stable/8/sys/cddl/contrib/opensolaris/ (props changed) stable/8/sys/contrib/dev/acpica/ (props changed) stable/8/sys/contrib/pf/ (props changed) stable/8/sys/dev/xen/xenpci/ (props changed) Modified: stable/8/sys/netinet/if_ether.c ============================================================================== --- stable/8/sys/netinet/if_ether.c Fri Aug 6 10:34:48 2010 (r210927) +++ stable/8/sys/netinet/if_ether.c Fri Aug 6 11:49:52 2010 (r210928) @@ -163,12 +163,10 @@ static void arptimer(void *arg) { struct ifnet *ifp; - struct llentry *lle = (struct llentry *)arg; + struct llentry *lle; - if (lle == NULL) { - panic("%s: NULL entry!\n", __func__); - return; - } + KASSERT(arg != NULL, ("%s: arg NULL", __func__)); + lle = (struct llentry *)arg; ifp = lle->lle_tbl->llt_ifp; CURVNET_SET(ifp->if_vnet); IF_AFDATA_LOCK(ifp); Modified: stable/8/sys/netinet6/nd6.c ============================================================================== --- stable/8/sys/netinet6/nd6.c Fri Aug 6 10:34:48 2010 (r210927) +++ stable/8/sys/netinet6/nd6.c Fri Aug 6 11:49:52 2010 (r210928) @@ -441,14 +441,9 @@ nd6_llinfo_timer(void *arg) struct ifnet *ifp; struct nd_ifinfo *ndi = NULL; + KASSERT(arg != NULL, ("%s: arg NULL", __func__)); ln = (struct llentry *)arg; - if (ln == NULL) { - panic("%s: NULL entry!\n", __func__); - return; - } - - if ((ifp = ((ln->lle_tbl != NULL) ? ln->lle_tbl->llt_ifp : NULL)) == NULL) - panic("ln ifp == NULL"); + ifp = ln->lle_tbl->llt_ifp; CURVNET_SET(ifp->if_vnet);