Skip site navigation (1)Skip section navigation (2)
Date:      Thu, 16 Oct 2014 20:46:02 +0000 (UTC)
From:      Gleb Smirnoff <glebius@FreeBSD.org>
To:        src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org
Subject:   svn commit: r273185 - stable/10/sys/net
Message-ID:  <201410162046.s9GKk2K6069586@svn.freebsd.org>

next in thread | raw e-mail | index | archive | help
Author: glebius
Date: Thu Oct 16 20:46:02 2014
New Revision: 273185
URL: https://svnweb.freebsd.org/changeset/base/273185

Log:
  Merge r272385 by melifaro from head:
    Free radix mask entries on main radix destroy.
    This is temporary commit to be merged to 10.
    Other approach (like hash table) should be used
    to store different masks.
  
  PR:             194078

Modified:
  stable/10/sys/net/radix.c
Directory Properties:
  stable/10/   (props changed)

Modified: stable/10/sys/net/radix.c
==============================================================================
--- stable/10/sys/net/radix.c	Thu Oct 16 20:43:12 2014	(r273184)
+++ stable/10/sys/net/radix.c	Thu Oct 16 20:46:02 2014	(r273185)
@@ -1204,6 +1204,18 @@ rn_inithead(void **head, int off)
 	return (1);
 }
 
+static int
+rn_freeentry(struct radix_node *rn, void *arg)
+{
+	struct radix_node_head * const rnh = arg;
+	struct radix_node *x;
+
+	x = (struct radix_node *)rn_delete(rn + 2, NULL, rnh);
+	if (x != NULL)
+		Free(x);
+	return (0);
+}
+
 int
 rn_detachhead(void **head)
 {
@@ -1214,6 +1226,7 @@ rn_detachhead(void **head)
 
 	rnh = *head;
 
+	rn_walktree(rnh->rnh_masks, rn_freeentry, rnh->rnh_masks);
 	rn_detachhead_internal((void **)&rnh->rnh_masks);
 	rn_detachhead_internal(head);
 	return (1);



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?201410162046.s9GKk2K6069586>