From owner-freebsd-virtualization@FreeBSD.ORG Mon Feb 24 09:00:01 2014 Return-Path: Delivered-To: freebsd-virtualization@smarthost.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id ABB152B6 for ; Mon, 24 Feb 2014 09:00:01 +0000 (UTC) Received: from freefall.freebsd.org (freefall.freebsd.org [IPv6:2001:1900:2254:206c::16:87]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id 7E49B1968 for ; Mon, 24 Feb 2014 09:00:01 +0000 (UTC) Received: from freefall.freebsd.org (localhost [127.0.0.1]) by freefall.freebsd.org (8.14.7/8.14.7) with ESMTP id s1O901rF087217 for ; Mon, 24 Feb 2014 09:00:01 GMT (envelope-from gnats@freefall.freebsd.org) Received: (from gnats@localhost) by freefall.freebsd.org (8.14.8/8.14.8/Submit) id s1O9010j087216; Mon, 24 Feb 2014 09:00:01 GMT (envelope-from gnats) Date: Mon, 24 Feb 2014 09:00:01 GMT Message-Id: <201402240900.s1O9010j087216@freefall.freebsd.org> To: freebsd-virtualization@FreeBSD.org Cc: From: dfilter@FreeBSD.ORG (dfilter service) Subject: Re: kern/183835: commit references a PR X-BeenThere: freebsd-virtualization@freebsd.org X-Mailman-Version: 2.1.17 Precedence: list Reply-To: dfilter service List-Id: "Discussion of various virtualization techniques FreeBSD supports." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 24 Feb 2014 09:00:01 -0000 The following reply was made to PR kern/183835; it has been noted by GNATS. From: dfilter@FreeBSD.ORG (dfilter service) To: bug-followup@FreeBSD.org Cc: Subject: Re: kern/183835: commit references a PR Date: Mon, 24 Feb 2014 08:50:19 +0000 (UTC) Author: rodrigc Date: Mon Feb 24 08:50:06 2014 New Revision: 262436 URL: http://svnweb.freebsd.org/changeset/base/262436 Log: MFC r262142: In ue_attach_post_task(), initialize curvnet to vnet0 before calling if_attach(). Before this patch, curvnet was NULL. When the VIMAGE kernel option is enabled, this eliminates kernel panics when USB ethernet devices are plugged in. PR: 183835 Submitted by: Hiroo Oono Modified: stable/10/sys/dev/usb/net/usb_ethernet.c Directory Properties: stable/10/ (props changed) Modified: stable/10/sys/dev/usb/net/usb_ethernet.c ============================================================================== --- stable/10/sys/dev/usb/net/usb_ethernet.c Mon Feb 24 08:21:49 2014 (r262435) +++ stable/10/sys/dev/usb/net/usb_ethernet.c Mon Feb 24 08:50:06 2014 (r262436) @@ -207,6 +207,7 @@ ue_attach_post_task(struct usb_proc_msg sysctl_ctx_init(&ue->ue_sysctl_ctx); error = 0; + CURVNET_SET_QUIET(vnet0); ifp = if_alloc(IFT_ETHER); if (ifp == NULL) { device_printf(ue->ue_dev, "could not allocate ifnet\n"); @@ -253,6 +254,8 @@ ue_attach_post_task(struct usb_proc_msg if (ifp->if_capabilities & IFCAP_VLAN_MTU) ifp->if_hdrlen = sizeof(struct ether_vlan_header); + CURVNET_RESTORE(); + snprintf(num, sizeof(num), "%u", ue->ue_unit); ue->ue_sysctl_oid = SYSCTL_ADD_NODE(&ue->ue_sysctl_ctx, &SYSCTL_NODE_CHILDREN(_net, ue), @@ -266,6 +269,7 @@ ue_attach_post_task(struct usb_proc_msg return; fail: + CURVNET_RESTORE(); free_unr(ueunit, ue->ue_unit); if (ue->ue_ifp != NULL) { if_free(ue->ue_ifp); _______________________________________________ svn-src-all@freebsd.org mailing list http://lists.freebsd.org/mailman/listinfo/svn-src-all To unsubscribe, send any mail to "svn-src-all-unsubscribe@freebsd.org"