changeset 2452:5298598f7174

2008-01-06 Shaun Louie <sal@microplex.com> * include/net/radix.h * src/sys/net/radix.c * src/sys/net/route.c * src/sys/net/rtsock.c * src/sys/netinet/if_ether.c * src/sys/netinet6/icmp6.c * src/sys/netinet6/nd6.c: Change Free to R_Free() so that it corresponds to R_Malloc, and allows Free() wrappers in other places.
author asl
date Sun, 06 Jan 2008 10:42:34 +0000
parents 8a8997415857
children 9ccbf76434a0
files packages/net/bsd_tcpip/current/ChangeLog packages/net/bsd_tcpip/current/include/net/radix.h packages/net/bsd_tcpip/current/src/sys/net/radix.c packages/net/bsd_tcpip/current/src/sys/net/route.c packages/net/bsd_tcpip/current/src/sys/net/rtsock.c packages/net/bsd_tcpip/current/src/sys/netinet/if_ether.c packages/net/bsd_tcpip/current/src/sys/netinet6/icmp6.c packages/net/bsd_tcpip/current/src/sys/netinet6/nd6.c
diffstat 8 files changed, 27 insertions(+), 15 deletions(-) [+]
line wrap: on
line diff
--- a/packages/net/bsd_tcpip/current/ChangeLog
+++ b/packages/net/bsd_tcpip/current/ChangeLog
@@ -1,3 +1,15 @@
+2008-01-06  Shaun Louie <sal@microplex.com>
+
+	* include/net/radix.h
+	* src/sys/net/radix.c
+	* src/sys/net/route.c
+	* src/sys/net/rtsock.c
+	* src/sys/netinet/if_ether.c
+	* src/sys/netinet6/icmp6.c
+	* src/sys/netinet6/nd6.c: Change Free to R_Free() so that it
+	corresponds to R_Malloc, and allows Free() wrappers in other
+	places.
+
 2007-09-27  Gary Thomas  <gary@mlbassoc.com>
 
 	* src/sys/net/if.c (ifioctl): Add missing ioctl functions
--- a/packages/net/bsd_tcpip/current/include/net/radix.h
+++ b/packages/net/bsd_tcpip/current/include/net/radix.h
@@ -162,13 +162,13 @@ struct radix_node_head {
 #define Bcopy(a, b, n) bcopy(((char *)(a)), ((char *)(b)), (unsigned)(n))
 #define Bzero(p, n) bzero((char *)(p), (int)(n));
 #define R_Malloc(p, t, n) (p = (t) malloc((unsigned int)(n)))
-#define Free(p) free((char *)p);
+#define R_Free(p) free((char *)p);
 #else
 #define Bcmp(a, b, n) bcmp(((caddr_t)(a)), ((caddr_t)(b)), (unsigned)(n))
 #define Bcopy(a, b, n) bcopy(((caddr_t)(a)), ((caddr_t)(b)), (unsigned)(n))
 #define Bzero(p, n) bzero((caddr_t)(p), (unsigned)(n));
 #define R_Malloc(p, t, n) (p = (t) malloc((unsigned long)(n), M_RTABLE, M_DONTWAIT))
-#define Free(p) free((caddr_t)p, M_RTABLE);
+#define R_Free(p) free((caddr_t)p, M_RTABLE);
 #endif /* _KERNEL */
 
 void	 rn_init __P((void));
--- a/packages/net/bsd_tcpip/current/src/sys/net/radix.c
+++ b/packages/net/bsd_tcpip/current/src/sys/net/radix.c
@@ -494,7 +494,7 @@ rn_addmask(n_arg, search, skip)
 	x = rn_insert(cp, mask_rnhead, &maskduplicated, x);
 	if (maskduplicated) {
 		log(LOG_ERR, "rn_addmask: mask impossibly already in tree");
-		Free(saved_x);
+		R_Free(saved_x);
 		return (x);
 	}
 	/*
--- a/packages/net/bsd_tcpip/current/src/sys/net/route.c
+++ b/packages/net/bsd_tcpip/current/src/sys/net/route.c
@@ -308,12 +308,12 @@ rtfree(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
 		 */
-		Free(rt);
+		R_Free(rt);
 	}
 }
 
@@ -663,7 +663,7 @@ rtrequest(req, dst, gateway, netmask, fl
 		 * also add the rt_gwroute if possible.
 		 */
 		if ((error = rt_setgate(rt, dst, gateway)) != 0) {
-			Free(rt);
+			R_Free(rt);
 			senderr(error);
 		}
 
@@ -727,8 +727,8 @@ rtrequest(req, dst, gateway, netmask, fl
 			if (rt->rt_ifa) {
 				IFAFREE(rt->rt_ifa);
 			}
-			Free(rt_key(rt));
-			Free(rt);
+			R_Free(rt_key(rt));
+			R_Free(rt);
 			senderr(EEXIST);
 		}
 
@@ -968,7 +968,7 @@ rt_setgate(rt0, dst, gate)
 	 */
 	if (old) {
 		Bcopy(dst, new, dlen);
-		Free(old);
+		R_Free(old);
 	}
 
 	/*
--- a/packages/net/bsd_tcpip/current/src/sys/net/rtsock.c
+++ b/packages/net/bsd_tcpip/current/src/sys/net/rtsock.c
@@ -408,7 +408,7 @@ route_output(m, so)
 				if (new_rtm == 0)
 					senderr(ENOBUFS);
 				Bcopy(rtm, new_rtm, rtm->rtm_msglen);
-				Free(rtm); rtm = new_rtm;
+				R_Free(rtm); rtm = new_rtm;
 			}
 			(void)rt_msg2(rtm->rtm_type, &info, (caddr_t)rtm,
 				(struct walkarg *)0);
@@ -492,7 +492,7 @@ flush:
 	if ((so->so_options & SO_USELOOPBACK) == 0) {
 		if (route_cb.any_count <= 1) {
 			if (rtm)
-				Free(rtm);
+				R_Free(rtm);
 			m_freem(m);
 			return (error);
 		}
@@ -506,7 +506,7 @@ flush:
 			m = NULL;
 		} else if (m->m_pkthdr.len > rtm->rtm_msglen)
 			m_adj(m, rtm->rtm_msglen - m->m_pkthdr.len);
-		Free(rtm);
+		R_Free(rtm);
 	}
 	if (rp)
 		rp->rcb_proto.sp_family = 0; /* Avoid us */
--- a/packages/net/bsd_tcpip/current/src/sys/netinet/if_ether.c
+++ b/packages/net/bsd_tcpip/current/src/sys/netinet/if_ether.c
@@ -290,7 +290,7 @@ arp_rtrequest(req, rt, sa)
 		rt->rt_flags &= ~RTF_LLINFO;
 		if (la->la_hold)
 			m_freem(la->la_hold);
-		Free((caddr_t)la);
+		R_Free((caddr_t)la);
 	}
 }
 
--- a/packages/net/bsd_tcpip/current/src/sys/netinet6/icmp6.c
+++ b/packages/net/bsd_tcpip/current/src/sys/netinet6/icmp6.c
@@ -3520,7 +3520,7 @@ icmp6_mtuexpire(rt, rtt)
 	struct rttimer *rtt;
 {
 	rt->rt_flags |= RTF_PROBEMTU;
-	Free(rtt);
+	R_Free(rtt);
 }
 
 int *icmp6_sysvars[] = ICMPV6CTL_VARS;
--- a/packages/net/bsd_tcpip/current/src/sys/netinet6/nd6.c
+++ b/packages/net/bsd_tcpip/current/src/sys/netinet6/nd6.c
@@ -1527,7 +1527,7 @@ nd6_rtrequest(req, rt, sa)
 		rt->rt_flags &= ~RTF_LLINFO;
 		if (ln->ln_hold)
 			m_freem(ln->ln_hold);
-		Free((caddr_t)ln);
+		R_Free((caddr_t)ln);
 	}
 }