diff options
author | Ted Unangst <tedu@cvs.openbsd.org> | 2014-01-09 21:57:53 +0000 |
---|---|---|
committer | Ted Unangst <tedu@cvs.openbsd.org> | 2014-01-09 21:57:53 +0000 |
commit | 989deaf07a7e429edf4ad45c6356bc14f6e4ec95 (patch) | |
tree | cdbf7f4824ec47916eeee31e57b2981f7bda1510 /sys/net | |
parent | fbf501a1477c4bc97ae0bb8f1ab6afc3f51138aa (diff) |
replace Bcopy macro with memmove and memcpy. ok mpi
Diffstat (limited to 'sys/net')
-rw-r--r-- | sys/net/radix.c | 8 | ||||
-rw-r--r-- | sys/net/radix.h | 3 | ||||
-rw-r--r-- | sys/net/route.c | 9 | ||||
-rw-r--r-- | sys/net/rtsock.c | 4 |
4 files changed, 12 insertions, 12 deletions
diff --git a/sys/net/radix.c b/sys/net/radix.c index 44b45b9febf..15ffac833d5 100644 --- a/sys/net/radix.c +++ b/sys/net/radix.c @@ -1,4 +1,4 @@ -/* $OpenBSD: radix.c,v 1.32 2013/12/12 14:43:38 millert Exp $ */ +/* $OpenBSD: radix.c,v 1.33 2014/01/09 21:57:51 tedu Exp $ */ /* $NetBSD: radix.c,v 1.20 2003/08/07 16:32:56 agc Exp $ */ /* @@ -419,9 +419,9 @@ rn_addmask(void *n_arg, int search, int skip) if (mlen <= skip) return (mask_rnhead->rnh_nodes); if (skip > 1) - Bcopy(rn_ones + 1, addmask_key + 1, skip - 1); + memmove(addmask_key + 1, rn_ones + 1, skip - 1); if ((m0 = mlen) > skip) - Bcopy(netmask + skip, addmask_key + skip, mlen - skip); + memmove(addmask_key + skip, netmask + skip, mlen - skip); /* * Trim trailing zeroes. */ @@ -446,7 +446,7 @@ rn_addmask(void *n_arg, int search, int skip) return (0); Bzero(x, max_keylen + 2 * sizeof (*x)); netmask = cp = (caddr_t)(x + 2); - Bcopy(addmask_key, cp, mlen); + memmove(cp, addmask_key, mlen); x = rn_insert(cp, mask_rnhead, &maskduplicated, x); if (maskduplicated) { log(LOG_ERR, "rn_addmask: mask impossibly already in tree\n"); diff --git a/sys/net/radix.h b/sys/net/radix.h index a8e3621921d..e8f27581714 100644 --- a/sys/net/radix.h +++ b/sys/net/radix.h @@ -1,4 +1,4 @@ -/* $OpenBSD: radix.h,v 1.20 2013/10/24 18:50:16 deraadt Exp $ */ +/* $OpenBSD: radix.h,v 1.21 2014/01/09 21:57:51 tedu Exp $ */ /* $NetBSD: radix.h,v 1.8 1996/02/13 22:00:37 christos Exp $ */ /* @@ -133,7 +133,6 @@ struct radix_node_head { #ifdef _KERNEL #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_NOWAIT)) #define Free(p) free((caddr_t)p, M_RTABLE); diff --git a/sys/net/route.c b/sys/net/route.c index cf90b51d865..8097142d49b 100644 --- a/sys/net/route.c +++ b/sys/net/route.c @@ -1,4 +1,4 @@ -/* $OpenBSD: route.c,v 1.147 2013/10/20 13:21:57 claudio Exp $ */ +/* $OpenBSD: route.c,v 1.148 2014/01/09 21:57:52 tedu Exp $ */ /* $NetBSD: route.c,v 1.14 1996/02/13 22:00:46 christos Exp $ */ /* @@ -843,7 +843,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, + memcpy(ndst, info->rti_info[RTAX_DST], info->rti_info[RTAX_DST]->sa_len); #ifndef SMALL_KERNEL if (rn_mpath_capable(rnh)) { @@ -1014,9 +1014,10 @@ rt_setgate(struct rtentry *rt, struct sockaddr *dst, struct sockaddr *gate, new = rt->rt_nodes->rn_key; old = NULL; } - Bcopy(gate, (rt->rt_gateway = (struct sockaddr *)(new + dlen)), glen); + rt->rt_gateway = (struct sockaddr *)(new + dlen); + memmove(rt->rt_gateway, gate, glen); if (old) { - Bcopy(dst, new, dlen); + memmove(new, dst, dlen); Free(old); } if (rt->rt_gwroute != NULL) { diff --git a/sys/net/rtsock.c b/sys/net/rtsock.c index 0796b67a12e..e46f1c3f259 100644 --- a/sys/net/rtsock.c +++ b/sys/net/rtsock.c @@ -1,4 +1,4 @@ -/* $OpenBSD: rtsock.c,v 1.131 2013/11/01 20:09:14 bluhm Exp $ */ +/* $OpenBSD: rtsock.c,v 1.132 2014/01/09 21:57:52 tedu Exp $ */ /* $NetBSD: rtsock.c,v 1.18 1996/03/29 00:32:10 cgd Exp $ */ /* @@ -767,7 +767,7 @@ report: error = ENOBUFS; goto flush; } - Bcopy(rtm, new_rtm, rtm->rtm_msglen); + memcpy(new_rtm, rtm, rtm->rtm_msglen); Free(rtm); rtm = new_rtm; } rt_msg2(rtm->rtm_type, RTM_VERSION, &info, (caddr_t)rtm, |