From owner-svn-src-all@freebsd.org Thu Feb 11 17:07:20 2016 Return-Path: Delivered-To: svn-src-all@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 B0F81AA5243; Thu, 11 Feb 2016 17:07:20 +0000 (UTC) (envelope-from dteske@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 6A34F362; Thu, 11 Feb 2016 17:07:20 +0000 (UTC) (envelope-from dteske@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u1BH7J3B040819; Thu, 11 Feb 2016 17:07:19 GMT (envelope-from dteske@FreeBSD.org) Received: (from dteske@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u1BH7JIw040816; Thu, 11 Feb 2016 17:07:19 GMT (envelope-from dteske@FreeBSD.org) Message-Id: <201602111707.u1BH7JIw040816@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: dteske set sender to dteske@FreeBSD.org using -f From: Devin Teske Date: Thu, 11 Feb 2016 17:07:19 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r295529 - in head/sys: net netinet netinet6 X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 11 Feb 2016 17:07:20 -0000 Author: dteske Date: Thu Feb 11 17:07:19 2016 New Revision: 295529 URL: https://svnweb.freebsd.org/changeset/base/295529 Log: Merge SVN r295220 (bz) from projects/vnet/ Fix a panic that occurs when a vnet interface is unavailable at the time the vnet jail referencing said interface is stopped. Sponsored by: FIS Global, Inc. Modified: head/sys/net/route.c head/sys/netinet/in_rmx.c head/sys/netinet6/in6_rmx.c Directory Properties: head/ (props changed) head/sys/ (props changed) Modified: head/sys/net/route.c ============================================================================== --- head/sys/net/route.c Thu Feb 11 16:54:23 2016 (r295528) +++ head/sys/net/route.c Thu Feb 11 17:07:19 2016 (r295529) @@ -353,10 +353,24 @@ rt_table_init(int offset) return (rh); } +static int +rt_freeentry(struct radix_node *rn, void *arg) +{ + struct radix_head * const rnh = arg; + struct radix_node *x; + + x = (struct radix_node *)rn_delete(rn + 2, NULL, rnh); + if (x != NULL) + R_Free(x); + return (0); +} + void rt_table_destroy(struct rib_head *rh) { + rn_walktree(&rh->rmhead.head, rt_freeentry, &rh->rmhead.head); + /* Assume table is already empty */ rw_destroy(&rh->rib_lock); free(rh, M_RTABLE); Modified: head/sys/netinet/in_rmx.c ============================================================================== --- head/sys/netinet/in_rmx.c Thu Feb 11 16:54:23 2016 (r295528) +++ head/sys/netinet/in_rmx.c Thu Feb 11 17:07:19 2016 (r295529) @@ -133,7 +133,8 @@ int in_detachhead(void **head, int off) { - return (rn_detachhead(head)); + rt_table_destroy((struct rib_head *)(*head)); + return (1); } #endif Modified: head/sys/netinet6/in6_rmx.c ============================================================================== --- head/sys/netinet6/in6_rmx.c Thu Feb 11 16:54:23 2016 (r295528) +++ head/sys/netinet6/in6_rmx.c Thu Feb 11 17:07:19 2016 (r295529) @@ -237,7 +237,9 @@ in6_detachhead(void **head, int off) { callout_drain(&V_rtq_mtutimer); - return (rn_detachhead(head)); + rt_table_destroy((struct rib_head *)(*head)); + + return (1); } #endif