diff --git a/src/usr.sbin/ntpd/client.c b/src/usr.sbin/ntpd/client.c index 09681db2..93e69ead 100644 --- a/src/usr.sbin/ntpd/client.c +++ b/src/usr.sbin/ntpd/client.c @@ -1,4 +1,4 @@ -/* $OpenBSD: client.c,v 1.101 2015/03/28 03:49:01 bcook Exp $ */ +/* $OpenBSD: client.c,v 1.102 2015/07/18 00:53:44 bcook Exp $ */ /* * Copyright (c) 2003, 2004 Henning Brauer @@ -215,7 +215,7 @@ client_dispatch(struct ntp_peer *p, u_int8_t settime) double T1, T2, T3, T4; time_t interval; - bzero(&somsg, sizeof(somsg)); + memset(&somsg, 0, sizeof(somsg)); iov[0].iov_base = buf; iov[0].iov_len = sizeof(buf); somsg.msg_iov = iov; diff --git a/src/usr.sbin/ntpd/config.c b/src/usr.sbin/ntpd/config.c index 35d7b31f..dc56b12b 100644 --- a/src/usr.sbin/ntpd/config.c +++ b/src/usr.sbin/ntpd/config.c @@ -1,4 +1,4 @@ -/* $OpenBSD: config.c,v 1.26 2015/02/10 06:40:08 reyk Exp $ */ +/* $OpenBSD: config.c,v 1.27 2015/07/18 00:53:44 bcook Exp $ */ /* * Copyright (c) 2003, 2004 Henning Brauer @@ -65,7 +65,7 @@ host_v4(const char *s) struct sockaddr_in *sa_in; struct ntp_addr *h; - bzero(&ina, sizeof(struct in_addr)); + memset(&ina, 0, sizeof(struct in_addr)); if (inet_pton(AF_INET, s, &ina) != 1) return (NULL); @@ -86,7 +86,7 @@ host_v6(const char *s) struct sockaddr_in6 *sa_in6; struct ntp_addr *h = NULL; - bzero(&hints, sizeof(hints)); + memset(&hints, 0, sizeof(hints)); hints.ai_family = AF_INET6; hints.ai_socktype = SOCK_DGRAM; /*dummy*/ hints.ai_flags = AI_NUMERICHOST; @@ -128,7 +128,7 @@ host_dns(const char *s, struct ntp_addr **hn) struct sockaddr_in6 *sa_in6; struct ntp_addr *h, *hh = NULL; - bzero(&hints, sizeof(hints)); + memset(&hints, 0, sizeof(hints)); hints.ai_family = PF_UNSPEC; hints.ai_socktype = SOCK_DGRAM; /* DUMMY */ /* ntpd MUST NOT use AI_ADDRCONFIG here */ diff --git a/src/usr.sbin/ntpd/control.c b/src/usr.sbin/ntpd/control.c index 867f9112..2dd76d16 100644 --- a/src/usr.sbin/ntpd/control.c +++ b/src/usr.sbin/ntpd/control.c @@ -1,4 +1,4 @@ -/* $OpenBSD: control.c,v 1.5 2015/02/10 06:40:08 reyk Exp $ */ +/* $OpenBSD: control.c,v 1.6 2015/07/18 00:53:44 bcook Exp $ */ /* * Copyright (c) 2003, 2004 Henning Brauer @@ -45,7 +45,7 @@ control_init(char *path) return (-1); } - bzero(&sa, sizeof(sa)); + memset(&sa, 0, sizeof(sa)); sa.sun_family = AF_UNIX; if (strlcpy(sa.sun_path, path, sizeof(sa.sun_path)) >= sizeof(sa.sun_path)) diff --git a/src/usr.sbin/ntpd/ntp.c b/src/usr.sbin/ntpd/ntp.c index 892509ca..bb9e2a44 100644 --- a/src/usr.sbin/ntpd/ntp.c +++ b/src/usr.sbin/ntpd/ntp.c @@ -1,4 +1,4 @@ -/* $OpenBSD: ntp.c,v 1.132 2015/05/25 14:58:34 deraadt Exp $ */ +/* $OpenBSD: ntp.c,v 1.133 2015/07/18 00:53:44 bcook Exp $ */ /* * Copyright (c) 2003, 2004 Henning Brauer @@ -188,7 +188,7 @@ ntp_main(int pipe_prnt[2], int fd_ctl, struct ntpd_conf *nconf, TAILQ_FOREACH(p, &conf->ntp_peers, entry) client_peer_init(p); - bzero(&conf->status, sizeof(conf->status)); + memset(&conf->status, 0, sizeof(conf->status)); conf->freq.num = 0; conf->freq.samples = 0; @@ -246,8 +246,8 @@ ntp_main(int pipe_prnt[2], int fd_ctl, struct ntpd_conf *nconf, pfd_elms = new_cnt; } - bzero(pfd, sizeof(*pfd) * pfd_elms); - bzero(idx2peer, sizeof(*idx2peer) * idx2peer_elms); + memset(pfd, 0, sizeof(*pfd) * pfd_elms); + memset(idx2peer, 0, sizeof(*idx2peer) * idx2peer_elms); nextaction = getmonotime() + 3600; pfd[PFD_PIPE_MAIN].fd = ibuf_main->fd; pfd[PFD_PIPE_MAIN].events = POLLIN; diff --git a/src/usr.sbin/ntpd/ntpd.c b/src/usr.sbin/ntpd/ntpd.c index b0ef5869..0b591e85 100644 --- a/src/usr.sbin/ntpd/ntpd.c +++ b/src/usr.sbin/ntpd/ntpd.c @@ -1,4 +1,4 @@ -/* $OpenBSD: ntpd.c,v 1.93 2015/03/11 19:38:48 jmc Exp $ */ +/* $OpenBSD: ntpd.c,v 1.94 2015/07/18 00:53:44 bcook Exp $ */ /* * Copyright (c) 2003, 2004 Henning Brauer @@ -119,7 +119,7 @@ main(int argc, char *argv[]) conffile = CONFFILE; - bzero(&lconf, sizeof(lconf)); + memset(&lconf, 0, sizeof(lconf)); log_init(1); /* log to stderr until daemonized */ @@ -557,7 +557,7 @@ ctl_main(int argc, char *argv[]) if ((fd = socket(AF_UNIX, SOCK_STREAM, 0)) == -1) err(1, "ntpctl: socket"); - bzero(&sa, sizeof(sa)); + memset(&sa, 0, sizeof(sa)); sa.sun_family = AF_UNIX; if (strlcpy(sa.sun_path, sockname, sizeof(sa.sun_path)) >= sizeof(sa.sun_path)) diff --git a/src/usr.sbin/ntpd/parse.y b/src/usr.sbin/ntpd/parse.y index 1295c7c9..52852f77 100644 --- a/src/usr.sbin/ntpd/parse.y +++ b/src/usr.sbin/ntpd/parse.y @@ -1,4 +1,4 @@ -/* $OpenBSD: parse.y,v 1.62 2015/05/17 18:31:32 reyk Exp $ */ +/* $OpenBSD: parse.y,v 1.63 2015/07/18 00:53:44 bcook Exp $ */ /* * Copyright (c) 2002, 2003, 2004 Henning Brauer @@ -426,7 +426,7 @@ rtable : RTABLE NUMBER { void opts_default(void) { - bzero(&opts, sizeof opts); + memset(&opts, 0, sizeof opts); opts.weight = 1; opts.rtable = -1; opts.stratum = 1; diff --git a/src/usr.sbin/ntpd/server.c b/src/usr.sbin/ntpd/server.c index 85f08378..06ee621f 100644 --- a/src/usr.sbin/ntpd/server.c +++ b/src/usr.sbin/ntpd/server.c @@ -1,4 +1,4 @@ -/* $OpenBSD: server.c,v 1.42 2015/05/19 16:07:38 reyk Exp $ */ +/* $OpenBSD: server.c,v 1.43 2015/07/18 00:53:44 bcook Exp $ */ /* * Copyright (c) 2003, 2004 Henning Brauer @@ -175,7 +175,7 @@ server_dispatch(int fd, struct ntpd_conf *lconf) if (ntp_getmsg((struct sockaddr *)&fsa, buf, size, &query) == -1) return (0); - bzero(&reply, sizeof(reply)); + memset(&reply, 0, sizeof(reply)); if (lconf->status.synced) reply.status = lconf->status.leap; else