Date: Thu, 11 Feb 2016 17:07:19 +0000 (UTC) From: Devin Teske <dteske@FreeBSD.org> 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 Message-ID: <201602111707.u1BH7JIw040816@repo.freebsd.org>
next in thread | raw e-mail | index | archive | help
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
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?201602111707.u1BH7JIw040816>