From owner-svn-src-head@freebsd.org Wed Jun 22 10:32:35 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 286B3B3BA58; Wed, 22 Jun 2016 10:32:35 +0000 (UTC) (envelope-from bz@FreeBSD.org) Received: from mx1.sbone.de (mx1.sbone.de [IPv6:2a01:4f8:130:3ffc::401:25]) (using TLSv1 with cipher DHE-RSA-CAMELLIA256-SHA (256/256 bits)) (Client CN "mx1.sbone.de", Issuer "SBone.DE" (not verified)) by mx1.freebsd.org (Postfix) with ESMTPS id E06FB12DE; Wed, 22 Jun 2016 10:32:34 +0000 (UTC) (envelope-from bz@FreeBSD.org) Received: from mail.sbone.de (mail.sbone.de [IPv6:fde9:577b:c1a9:31::2013:587]) (using TLSv1 with cipher ADH-CAMELLIA256-SHA (256/256 bits)) (No client certificate requested) by mx1.sbone.de (Postfix) with ESMTPS id E586D25D37C2; Wed, 22 Jun 2016 10:32:30 +0000 (UTC) Received: from content-filter.sbone.de (content-filter.sbone.de [IPv6:fde9:577b:c1a9:31::2013:2742]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (No client certificate requested) by mail.sbone.de (Postfix) with ESMTPS id BA38CD1F7E4; Wed, 22 Jun 2016 10:32:29 +0000 (UTC) X-Virus-Scanned: amavisd-new at sbone.de Received: from mail.sbone.de ([IPv6:fde9:577b:c1a9:31::2013:587]) by content-filter.sbone.de (content-filter.sbone.de [fde9:577b:c1a9:31::2013:2742]) (amavisd-new, port 10024) with ESMTP id 8ZJ0xH5vZmmg; Wed, 22 Jun 2016 10:32:28 +0000 (UTC) Received: from nv.sbone.de (nv.sbone.de [IPv6:fde9:577b:c1a9:31::2013:138]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (No client certificate requested) by mail.sbone.de (Postfix) with ESMTPSA id 6821BD1F7E0; Wed, 22 Jun 2016 10:32:28 +0000 (UTC) Date: Wed, 22 Jun 2016 10:32:27 +0000 (UTC) From: "Bjoern A. Zeeb" To: Navdeep Parhar cc: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: Re: svn commit: r302054 - in head/sys: contrib/ipfilter/netinet dev/usb/net kern net netgraph netinet netinet6 netipsec netpfil/ipfw netpfil/pf In-Reply-To: Message-ID: References: <201606211348.u5LDmom9081605@repo.freebsd.org> X-OpenPGP-Key-Id: 0x14003F198FEFA3E77207EE8D2B58B8F83CCF1842 MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII; format=flowed X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.22 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 22 Jun 2016 10:32:35 -0000 On Tue, 21 Jun 2016, Navdeep Parhar wrote: > This causes a panic when a NIC driver module is unloaded from a kernel > without VIMAGE. if_vnet is NULL and if_detach_internal tries to > dereference it. whoops; I'll try this patch in a few minutes but if it works for you let me know and I'll get it in. Index: sys/net/if.c =================================================================== --- sys/net/if.c (revision 302079) +++ sys/net/if.c (working copy) @@ -933,8 +933,12 @@ if_detach_internal(struct ifnet *ifp, int vmove, s struct ifnet *iter; int found = 0, shutdown; +#ifdef VIMAGE shutdown = (ifp->if_vnet->vnet_state > SI_SUB_VNET && ifp->if_vnet->vnet_state < SI_SUB_VNET_DONE) ? 1 : 0; +#else + shutdown = 0; +#endif IFNET_WLOCK(); TAILQ_FOREACH(iter, &V_ifnet, if_link) if (iter == ifp) { /bz