From 8b15f615e03e05781e90e8def1cb585a43b16664 Mon Sep 17 00:00:00 2001 From: Luiz Otavio O Souza Date: Thu, 30 Jul 2015 02:09:03 +0000 Subject: [PATCH] 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 --- sys/net/radix.c | 10 +++++----- sys/net/radix.h | 2 +- sys/net/route.c | 8 ++++---- 3 files changed, 10 insertions(+), 10 deletions(-) diff --git a/sys/net/radix.c b/sys/net/radix.c index d16c9249072..d6db35ea3a9 100644 --- a/sys/net/radix.c +++ b/sys/net/radix.c @@ -533,7 +533,7 @@ rn_addmask(void *n_arg, struct radix_node_head *maskhead, int search, int skip) 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, struct radix_node_head *head) 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 nodes. */ - Free(rnh); + R_Free(rnh); *head = NULL; } @@ -1186,7 +1186,7 @@ rn_freeentry(struct radix_node *rn, void *arg) x = (struct radix_node *)rn_delete(rn + 2, NULL, rnh); if (x != NULL) - Free(x); + R_Free(x); return (0); } diff --git a/sys/net/radix.h b/sys/net/radix.h index cc262fa745e..d4bb58a47ed 100644 --- a/sys/net/radix.h +++ b/sys/net/radix.h @@ -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) diff --git a/sys/net/route.c b/sys/net/route.c index 992cf8e72b0..a88742267cc 100644 --- a/sys/net/route.c +++ b/sys/net/route.c @@ -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_addrinfo *info, struct rtentry **ret_nrt, 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_addrinfo *info, struct rtentry **ret_nrt, */ 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 sockaddr *dst, struct sockaddr *gate) * 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); }