summaryrefslogtreecommitdiffstats
path: root/usr.sbin/dhcpd
diff options
context:
space:
mode:
authormestre <mestre@openbsd.org>2016-11-15 10:49:37 +0000
committermestre <mestre@openbsd.org>2016-11-15 10:49:37 +0000
commit359ce2c32fc506679dbe73afaa5d39286911a466 (patch)
tree56c08b7d63bbaa755aecd0a88f6becbf01711964 /usr.sbin/dhcpd
parentrtable_init() now creates the default routing table. (diff)
downloadwireguard-openbsd-359ce2c32fc506679dbe73afaa5d39286911a466.tar.xz
wireguard-openbsd-359ce2c32fc506679dbe73afaa5d39286911a466.zip
Replace bzero(3) with memset(3)
"Looks good" to deraadt@
Diffstat (limited to 'usr.sbin/dhcpd')
-rw-r--r--usr.sbin/dhcpd/dispatch.c6
-rw-r--r--usr.sbin/dhcpd/icmp.c4
-rw-r--r--usr.sbin/dhcpd/options.c6
-rw-r--r--usr.sbin/dhcpd/pfutils.c14
4 files changed, 15 insertions, 15 deletions
diff --git a/usr.sbin/dhcpd/dispatch.c b/usr.sbin/dhcpd/dispatch.c
index aa079215d52..023aac6dd4d 100644
--- a/usr.sbin/dhcpd/dispatch.c
+++ b/usr.sbin/dhcpd/dispatch.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: dispatch.c,v 1.37 2016/08/27 01:26:22 guenther Exp $ */
+/* $OpenBSD: dispatch.c,v 1.38 2016/11/15 10:49:37 mestre Exp $ */
/*
* Copyright (c) 1995, 1996, 1997, 1998, 1999
@@ -412,7 +412,7 @@ got_one(struct protocol *l)
} u;
struct interface_info *ip = l->local;
- bzero(&u, sizeof(u));
+ memset(&u, 0, sizeof(u));
if ((result = receive_packet(ip, u.packbuf, sizeof u,
&from, &hfrom)) == -1) {
@@ -652,7 +652,7 @@ get_rdomain(char *name)
if ((s = socket(AF_INET, SOCK_DGRAM, 0)) == -1)
error("get_rdomain socket: %m");
- bzero(&ifr, sizeof(ifr));
+ memset(&ifr, 0, sizeof(ifr));
strlcpy(ifr.ifr_name, name, sizeof(ifr.ifr_name));
if (ioctl(s, SIOCGIFRDOMAIN, (caddr_t)&ifr) != -1)
rv = ifr.ifr_rdomainid;
diff --git a/usr.sbin/dhcpd/icmp.c b/usr.sbin/dhcpd/icmp.c
index 2d95ac28227..7c1ea841c78 100644
--- a/usr.sbin/dhcpd/icmp.c
+++ b/usr.sbin/dhcpd/icmp.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: icmp.c,v 1.14 2016/02/06 23:50:10 krw Exp $ */
+/* $OpenBSD: icmp.c,v 1.15 2016/11/15 10:49:37 mestre Exp $ */
/*
* Copyright (c) 1997, 1998 The Internet Software Consortium.
@@ -100,7 +100,7 @@ icmp_echorequest(struct iaddr *addr)
if (!icmp_protocol_initialized)
error("attempt to use ICMP protocol before initialization.");
- bzero(&to, sizeof(to));
+ memset(&to, 0, sizeof(to));
to.sin_len = sizeof to;
to.sin_family = AF_INET;
memcpy(&to.sin_addr, addr->iabuf, sizeof to.sin_addr); /* XXX */
diff --git a/usr.sbin/dhcpd/options.c b/usr.sbin/dhcpd/options.c
index eae11f2fcd0..ac9c425c621 100644
--- a/usr.sbin/dhcpd/options.c
+++ b/usr.sbin/dhcpd/options.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: options.c,v 1.32 2016/10/04 22:47:51 krw Exp $ */
+/* $OpenBSD: options.c,v 1.33 2016/11/15 10:49:37 mestre Exp $ */
/* DHCP options parsing and reassembly. */
@@ -221,7 +221,7 @@ create_priority_list(unsigned char *priority_list, unsigned char *prl,
int i, priority_len = 0;
/* clear stored_list, priority_list should be cleared before */
- bzero(&stored_list, sizeof(stored_list));
+ memset(&stored_list, 0, sizeof(stored_list));
/* Some options we don't want on the priority list. */
stored_list[DHO_PAD] = 1;
@@ -322,7 +322,7 @@ cons_options(struct packet *inpacket, struct dhcp_packet *outpacket,
* list provided in the options. Lacking that use the list provided by
* prl. If that is not available just use the default list.
*/
- bzero(&priority_list, sizeof(priority_list));
+ memset(&priority_list, 0, sizeof(priority_list));
if (inpacket && inpacket->options[DHO_DHCP_PARAMETER_REQUEST_LIST].data)
create_priority_list(priority_list,
inpacket->options[DHO_DHCP_PARAMETER_REQUEST_LIST].data,
diff --git a/usr.sbin/dhcpd/pfutils.c b/usr.sbin/dhcpd/pfutils.c
index 10c8c290ad0..401eee02539 100644
--- a/usr.sbin/dhcpd/pfutils.c
+++ b/usr.sbin/dhcpd/pfutils.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: pfutils.c,v 1.14 2016/02/06 23:50:10 krw Exp $ */
+/* $OpenBSD: pfutils.c,v 1.15 2016/11/15 10:49:37 mestre Exp $ */
/*
* Copyright (c) 2006 Chris Kuethe <ckuethe@openbsd.org>
*
@@ -76,7 +76,7 @@ pftable_handler()
error("pf pipe closed");
if (nfds > 0 && (pfd[0].revents & POLLIN)) {
- bzero(&cmd, l);
+ memset(&cmd, 0, l);
r = atomicio(read, pfpipe[0], &cmd, l);
if (r != l)
@@ -141,14 +141,14 @@ pf_change_table(int fd, int op, struct in_addr ip, char *table)
if (table == NULL)
return;
- bzero(&io, sizeof(io));
+ memset(&io, 0, sizeof(io));
strlcpy(io.pfrio_table.pfrt_name, table,
sizeof(io.pfrio_table.pfrt_name));
io.pfrio_buffer = &addr;
io.pfrio_esize = sizeof(addr);
io.pfrio_size = 1;
- bzero(&addr, sizeof(addr));
+ memset(&addr, 0, sizeof(addr));
memcpy(&addr.pfra_ip4addr, &ip, 4);
addr.pfra_af = AF_INET;
addr.pfra_net = 32;
@@ -166,8 +166,8 @@ pf_kill_state(int fd, struct in_addr ip)
struct pfioc_state_kill psk;
struct pf_addr target;
- bzero(&psk, sizeof(psk));
- bzero(&target, sizeof(target));
+ memset(&psk, 0, sizeof(psk));
+ memset(&target, 0, sizeof(target));
memcpy(&target.v4, &ip.s_addr, 4);
psk.psk_af = AF_INET;
@@ -182,7 +182,7 @@ pf_kill_state(int fd, struct in_addr ip)
}
/* Kill all states to target */
- bzero(&psk.psk_src, sizeof(psk.psk_src));
+ memset(&psk.psk_src, 0, sizeof(psk.psk_src));
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,