diff options
author | Hajimu UMEMOTO <ume@FreeBSD.org> | 2003-08-11 15:49:47 +0000 |
---|---|---|
committer | Hajimu UMEMOTO <ume@FreeBSD.org> | 2003-08-11 15:49:47 +0000 |
commit | bb58b617fb2f8a97f28b34166dbe65ec8e656b68 (patch) | |
tree | 1c20b2e94f632085097f94556620788a63d45a06 /usr.sbin/rtsold/probe.c | |
parent | c0efcff271dc57745fc275d484ac7de377e3fcf3 (diff) | |
download | src-bb58b617fb2f8a97f28b34166dbe65ec8e656b68.tar.gz src-bb58b617fb2f8a97f28b34166dbe65ec8e656b68.zip |
use strlcpy() and snprintf().
Obtained from: KAME
MFC after: 1 week
Notes
Notes:
svn path=/head/; revision=118786
Diffstat (limited to 'usr.sbin/rtsold/probe.c')
-rw-r--r-- | usr.sbin/rtsold/probe.c | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/usr.sbin/rtsold/probe.c b/usr.sbin/rtsold/probe.c index 33f33f9cb3d3..a946381d3ff1 100644 --- a/usr.sbin/rtsold/probe.c +++ b/usr.sbin/rtsold/probe.c @@ -110,8 +110,8 @@ defrouter_probe(int ifindex) warnmsg(LOG_ERR, __func__, "socket: %s", strerror(errno)); return; } - bzero(&dr, sizeof(dr)); - strcpy(dr.ifname, "lo0"); /* dummy interface */ + memset(&dr, 0, sizeof(dr)); + strlcpy(dr.ifname, "lo0", sizeof dr.ifname); /* dummy interface */ if (ioctl(s, SIOCGDRLST_IN6, (caddr_t)&dr) < 0) { warnmsg(LOG_ERR, __func__, "ioctl(SIOCGDRLST_IN6): %s", strerror(errno)); @@ -148,7 +148,7 @@ sendprobe(struct in6_addr *addr, int ifindex) u_char ntopbuf[INET6_ADDRSTRLEN], ifnamebuf[IFNAMSIZ]; int hoplimit = 1; - bzero(&sa6_probe, sizeof(sa6_probe)); + memset(&sa6_probe, 0, sizeof(sa6_probe)); sa6_probe.sin6_family = AF_INET6; sa6_probe.sin6_len = sizeof(sa6_probe); sa6_probe.sin6_addr = *addr; |