Skip site navigation (1)Skip section navigation (2)
Date:      Thu, 30 Jul 2015 02:09:04 +0000 (UTC)
From:      Luiz Otavio O Souza <loos@FreeBSD.org>
To:        src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org
Subject:   svn commit: r286057 - head/sys/net
Message-ID:  <201507300209.t6U2944l063502@repo.freebsd.org>

next in thread | raw e-mail | index | archive | help
Author: loos
Date: Thu Jul 30 02:09:03 2015
New Revision: 286057
URL: https://svnweb.freebsd.org/changeset/base/286057

Log:
  Follow r256586 and rename the kernel version of the Free() macro to
  R_Free().  This matches the other macros and reduces the chances to clash
  with other headers.
  
  This also fixes the build of radix.c outside of the kernel environment.
  
  Reviewed by:	glebius

Modified:
  head/sys/net/radix.c
  head/sys/net/radix.h
  head/sys/net/route.c

Modified: head/sys/net/radix.c
==============================================================================
--- head/sys/net/radix.c	Thu Jul 30 02:06:34 2015	(r286056)
+++ head/sys/net/radix.c	Thu Jul 30 02:09:03 2015	(r286057)
@@ -533,7 +533,7 @@ rn_addmask(void *n_arg, struct radix_nod
 	x = rn_insert(cp, maskhead, &maskduplicated, x);
 	if (maskduplicated) {
 		log(LOG_ERR, "rn_addmask: mask impossibly already in tree");
-		Free(saved_x);
+		R_Free(saved_x);
 		return (x);
 	}
 	/*
@@ -829,7 +829,7 @@ rn_delete(void *v_arg, void *netmask_arg
 	for (mp = &x->rn_mklist; (m = *mp); mp = &m->rm_mklist)
 		if (m == saved_m) {
 			*mp = m->rm_mklist;
-			Free(m);
+			R_Free(m);
 			break;
 		}
 	if (m == 0) {
@@ -920,7 +920,7 @@ on1:
 					struct radix_mask *mm = m->rm_mklist;
 					x->rn_mklist = 0;
 					if (--(m->rm_refs) < 0)
-						Free(m);
+						R_Free(m);
 					m = mm;
 				}
 			if (m)
@@ -1152,7 +1152,7 @@ rn_detachhead_internal(void **head)
 	rnh = *head;
 	
 	/* Free <left,root,right> nodes. */
-	Free(rnh);
+	R_Free(rnh);
 
 	*head = NULL;
 }
@@ -1186,7 +1186,7 @@ rn_freeentry(struct radix_node *rn, void
 
 	x = (struct radix_node *)rn_delete(rn + 2, NULL, rnh);
 	if (x != NULL)
-		Free(x);
+		R_Free(x);
 	return (0);
 }
 

Modified: head/sys/net/radix.h
==============================================================================
--- head/sys/net/radix.h	Thu Jul 30 02:06:34 2015	(r286056)
+++ head/sys/net/radix.h	Thu Jul 30 02:09:03 2015	(r286057)
@@ -137,7 +137,7 @@ struct radix_node_head {
 #else
 #define R_Malloc(p, t, n) (p = (t) malloc((unsigned long)(n), M_RTABLE, M_NOWAIT))
 #define R_Zalloc(p, t, n) (p = (t) malloc((unsigned long)(n), M_RTABLE, M_NOWAIT | M_ZERO))
-#define Free(p) free((caddr_t)p, M_RTABLE);
+#define R_Free(p) free((caddr_t)p, M_RTABLE);
 
 #define	RADIX_NODE_HEAD_LOCK_INIT(rnh)	\
     rw_init_flags(&(rnh)->rnh_lock, "radix node head", 0)

Modified: head/sys/net/route.c
==============================================================================
--- head/sys/net/route.c	Thu Jul 30 02:06:34 2015	(r286056)
+++ head/sys/net/route.c	Thu Jul 30 02:09:03 2015	(r286057)
@@ -519,7 +519,7 @@ rtfree(struct rtentry *rt)
 		 * This also frees the gateway, as they are always malloc'd
 		 * together.
 		 */
-		Free(rt_key(rt));
+		R_Free(rt_key(rt));
 
 		/*
 		 * and the rtentry itself of course
@@ -1352,7 +1352,7 @@ rtrequest1_fib(int req, struct rt_addrin
 		if (rn_mpath_capable(rnh) &&
 			rt_mpath_conflict(rnh, rt, netmask)) {
 			ifa_free(rt->rt_ifa);
-			Free(rt_key(rt));
+			R_Free(rt_key(rt));
 			uma_zfree(V_rtzone, rt);
 			senderr(EEXIST);
 		}
@@ -1419,7 +1419,7 @@ rtrequest1_fib(int req, struct rt_addrin
 		 */
 		if (rn == NULL) {
 			ifa_free(rt->rt_ifa);
-			Free(rt_key(rt));
+			R_Free(rt_key(rt));
 			uma_zfree(V_rtzone, rt);
 #ifdef FLOWTABLE
 			if (rt0 != NULL)
@@ -1641,7 +1641,7 @@ rt_setgate(struct rtentry *rt, struct so
 		 * Free()/free() handle a NULL argument just fine.
 		 */
 		bcopy(dst, new, dlen);
-		Free(rt_key(rt));	/* free old block, if any */
+		R_Free(rt_key(rt));	/* free old block, if any */
 		rt_key(rt) = (struct sockaddr *)new;
 		rt->rt_gateway = (struct sockaddr *)(new + dlen);
 	}



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