diff options
author | Kenneth R Westerback <krw@cvs.openbsd.org> | 2013-10-18 15:19:41 +0000 |
---|---|---|
committer | Kenneth R Westerback <krw@cvs.openbsd.org> | 2013-10-18 15:19:41 +0000 |
commit | 012b489a7c882796cd8e5eabe82e2ea51ccceeca (patch) | |
tree | e8b089d9b05236c3dfb2d829a5a760066044b9e5 | |
parent | 6d98ff92ff0fa31ab8b7110d36fbb0ea16fcbbf3 (diff) |
Scattering a few bcopy()'s around source using mostly memcpy() is just
asking for confusion. Replace bcopy()'s with memcpy()'s.
-rw-r--r-- | usr.sbin/dhcpd/dispatch.c | 4 | ||||
-rw-r--r-- | usr.sbin/dhcpd/pfutils.c | 12 | ||||
-rw-r--r-- | usr.sbin/dhcpd/sync.c | 4 |
3 files changed, 10 insertions, 10 deletions
diff --git a/usr.sbin/dhcpd/dispatch.c b/usr.sbin/dhcpd/dispatch.c index debcae79d1c..0e78bc96200 100644 --- a/usr.sbin/dhcpd/dispatch.c +++ b/usr.sbin/dhcpd/dispatch.c @@ -1,4 +1,4 @@ -/* $OpenBSD: dispatch.c,v 1.31 2013/05/16 19:24:12 gerhard Exp $ */ +/* $OpenBSD: dispatch.c,v 1.32 2013/10/18 15:19:39 krw Exp $ */ /* * Copyright (c) 1995, 1996, 1997, 1998, 1999 @@ -147,7 +147,7 @@ discover_interfaces(int *rdomain) struct iaddr addr; /* Get a pointer to the address... */ - bcopy(ifa->ifa_addr, &foo, sizeof(foo)); + memcpy(&foo, ifa->ifa_addr, sizeof(foo)); /* We don't want the loopback interface. */ if (foo.sin_addr.s_addr == htonl (INADDR_LOOPBACK)) diff --git a/usr.sbin/dhcpd/pfutils.c b/usr.sbin/dhcpd/pfutils.c index 7d56d1f0043..1a1d36846eb 100644 --- a/usr.sbin/dhcpd/pfutils.c +++ b/usr.sbin/dhcpd/pfutils.c @@ -1,4 +1,4 @@ -/* $OpenBSD: pfutils.c,v 1.9 2007/12/23 21:52:16 jmc Exp $ */ +/* $OpenBSD: pfutils.c,v 1.10 2013/10/18 15:19:39 krw Exp $ */ /* * Copyright (c) 2006 Chris Kuethe <ckuethe@openbsd.org> * @@ -147,7 +147,7 @@ pf_change_table(int fd, int op, struct in_addr ip, char *table) io.pfrio_size = 1; bzero(&addr, sizeof(addr)); - bcopy(&ip, &addr.pfra_ip4addr, 4); + memcpy(&addr.pfra_ip4addr, &ip, 4); addr.pfra_af = AF_INET; addr.pfra_net = 32; @@ -167,11 +167,11 @@ pf_kill_state(int fd, struct in_addr ip) bzero(&psk, sizeof(psk)); bzero(&target, sizeof(target)); - bcopy(&ip.s_addr, &target.v4, 4); + memcpy(&target.v4, &ip.s_addr, 4); psk.psk_af = AF_INET; /* Kill all states from target */ - bcopy(&target, &psk.psk_src.addr.v.a.addr, + memcpy(&psk.psk_src.addr.v.a.addr, &target, sizeof(psk.psk_src.addr.v.a.addr)); memset(&psk.psk_src.addr.v.a.mask, 0xff, sizeof(psk.psk_src.addr.v.a.mask)); @@ -181,7 +181,7 @@ pf_kill_state(int fd, struct in_addr ip) /* Kill all states to target */ bzero(&psk.psk_src, sizeof(psk.psk_src)); - bcopy(&target, &psk.psk_dst.addr.v.a.addr, + memcpy(&psk.psk_dst.addr.v.a.addr, &target, sizeof(psk.psk_dst.addr.v.a.addr)); memset(&psk.psk_dst.addr.v.a.mask, 0xff, sizeof(psk.psk_dst.addr.v.a.mask)); @@ -230,7 +230,7 @@ pfmsg(char c, struct lease *lp) return; cmd.type = c; - bcopy(lp->ip_addr.iabuf, &cmd.ip.s_addr, 4); + memcpy(&cmd.ip.s_addr, lp->ip_addr.iabuf, 4); switch (c) { case 'A': /* address is being abandoned */ diff --git a/usr.sbin/dhcpd/sync.c b/usr.sbin/dhcpd/sync.c index f8dde4e0ddb..27346b82854 100644 --- a/usr.sbin/dhcpd/sync.c +++ b/usr.sbin/dhcpd/sync.c @@ -1,4 +1,4 @@ -/* $OpenBSD: sync.c,v 1.14 2013/10/18 13:44:35 krw Exp $ */ +/* $OpenBSD: sync.c,v 1.15 2013/10/18 15:19:40 krw Exp $ */ /* * Copyright (c) 2008 Bob Beck <beck@openbsd.org> @@ -275,7 +275,7 @@ sync_recv(void) len = ntohs(hdr->sh_length); /* Compute and validate HMAC */ - bcopy(hdr->sh_hmac, hmac[0], DHCP_SYNC_HMAC_LEN); + memcpy(hmac[0], hdr->sh_hmac, DHCP_SYNC_HMAC_LEN); bzero(hdr->sh_hmac, DHCP_SYNC_HMAC_LEN); HMAC(EVP_sha1(), sync_key, strlen(sync_key), buf, len, hmac[1], &hmac_len); |