summaryrefslogtreecommitdiff
path: root/sys/net
diff options
context:
space:
mode:
authorBret Lambert <blambert@cvs.openbsd.org>2011-04-04 14:08:16 +0000
committerBret Lambert <blambert@cvs.openbsd.org>2011-04-04 14:08:16 +0000
commitcfa4ccb854c4c0485f159f340d7547dabee37de1 (patch)
treedbae2ec457304d63c90fa3e65fe4e12b8ae5e3e8 /sys/net
parentc731aa413bf6eb6436cb2191ccba3269214873d4 (diff)
stop using the stupid R_Malloc/Bcopy/Free macros, and just start using
malloc/bcopy/free, the way He Who Must Not Be Named intended. "yes please" claudio@
Diffstat (limited to 'sys/net')
-rw-r--r--sys/net/route.c23
1 files changed, 11 insertions, 12 deletions
diff --git a/sys/net/route.c b/sys/net/route.c
index 4fab3e1cccb..ba60bac2746 100644
--- a/sys/net/route.c
+++ b/sys/net/route.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: route.c,v 1.128 2010/11/16 19:39:17 bluhm Exp $ */
+/* $OpenBSD: route.c,v 1.129 2011/04/04 14:08:15 blambert Exp $ */
/* $NetBSD: route.c,v 1.14 1996/02/13 22:00:46 christos Exp $ */
/*
@@ -403,7 +403,7 @@ rtfree(struct rtentry *rt)
if (rt->rt_flags & RTF_MPLS)
free(rt->rt_llinfo, M_TEMP);
#endif
- Free(rt_key(rt));
+ free(rt_key(rt), M_RTABLE);
pool_put(&rtentry_pool, rt);
}
}
@@ -839,7 +839,7 @@ rtrequest1(int req, struct rt_addrinfo *info, u_int8_t prio,
rt_maskedcopy(info->rti_info[RTAX_DST], ndst,
info->rti_info[RTAX_NETMASK]);
} else
- Bcopy(info->rti_info[RTAX_DST], ndst,
+ bcopy(info->rti_info[RTAX_DST], ndst,
info->rti_info[RTAX_DST]->sa_len);
#ifndef SMALL_KERNEL
if (rn_mpath_capable(rnh)) {
@@ -849,7 +849,7 @@ rtrequest1(int req, struct rt_addrinfo *info, u_int8_t prio,
info->rti_flags & RTF_MPATH)) {
if (rt->rt_gwroute)
rtfree(rt->rt_gwroute);
- Free(rt_key(rt));
+ free(rt_key(rt), M_RTABLE);
pool_put(&rtentry_pool, rt);
senderr(EEXIST);
}
@@ -881,13 +881,13 @@ rtrequest1(int req, struct rt_addrinfo *info, u_int8_t prio,
sa_mpls = (struct sockaddr_mpls *)
info->rti_info[RTAX_SRC];
- rt->rt_llinfo = (caddr_t)malloc(sizeof(struct rt_mpls),
+ rt->rt_llinfo = malloc(sizeof(struct rt_mpls),
M_TEMP, M_NOWAIT|M_ZERO);
if (rt->rt_llinfo == NULL) {
if (rt->rt_gwroute)
rtfree(rt->rt_gwroute);
- Free(rt_key(rt));
+ free(rt_key(rt), M_RTABLE);
pool_put(&rtentry_pool, rt);
senderr(ENOMEM);
}
@@ -958,7 +958,7 @@ rtrequest1(int req, struct rt_addrinfo *info, u_int8_t prio,
rtfree(rt->rt_parent);
if (rt->rt_gwroute)
rtfree(rt->rt_gwroute);
- Free(rt_key(rt));
+ free(rt_key(rt), M_RTABLE);
pool_put(&rtentry_pool, rt);
senderr(EEXIST);
}
@@ -1005,18 +1005,17 @@ rt_setgate(struct rtentry *rt0, struct sockaddr *dst, struct sockaddr *gate,
if (rt->rt_gateway == NULL || glen > ROUNDUP(rt->rt_gateway->sa_len)) {
old = (caddr_t)rt_key(rt);
- R_Malloc(new, caddr_t, dlen + glen);
- if (new == NULL)
+ if ((new = malloc(sizeof(*new), M_RTABLE, M_NOWAIT)) == NULL)
return 1;
rt->rt_nodes->rn_key = new;
} else {
new = rt->rt_nodes->rn_key;
old = NULL;
}
- Bcopy(gate, (rt->rt_gateway = (struct sockaddr *)(new + dlen)), glen);
+ bcopy(gate, (rt->rt_gateway = (struct sockaddr *)(new + dlen)), glen);
if (old) {
- Bcopy(dst, new, dlen);
- Free(old);
+ bcopy(dst, new, dlen);
+ free(old, M_RTABLE);
}
if (rt->rt_gwroute != NULL) {
rt = rt->rt_gwroute;