summaryrefslogtreecommitdiff
path: root/usr.sbin
diff options
context:
space:
mode:
authorClaudio Jeker <claudio@cvs.openbsd.org>2008-07-24 18:47:00 +0000
committerClaudio Jeker <claudio@cvs.openbsd.org>2008-07-24 18:47:00 +0000
commit7687778e2918999d977249922bd189bc3371ae1d (patch)
treec575f7a4cb85c7292878b3f0cc10d4bfc47c64e0 /usr.sbin
parentc0047a9bfb99bc5c504b642d90372e6b5a910e34 (diff)
Use memcpy() and memcmp() like everywhere else in ospfd. OK norby@
Diffstat (limited to 'usr.sbin')
-rw-r--r--usr.sbin/ospfd/auth.c8
-rw-r--r--usr.sbin/ospfd/kroute.c4
2 files changed, 6 insertions, 6 deletions
diff --git a/usr.sbin/ospfd/auth.c b/usr.sbin/ospfd/auth.c
index 0ff55f15894..cbb439ea43b 100644
--- a/usr.sbin/ospfd/auth.c
+++ b/usr.sbin/ospfd/auth.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: auth.c,v 1.13 2008/02/11 11:50:30 norby Exp $ */
+/* $OpenBSD: auth.c,v 1.14 2008/07/24 18:46:59 claudio Exp $ */
/*
* Copyright (c) 2004, 2005 Esben Norby <norby@openbsd.org>
@@ -48,7 +48,7 @@ auth_validate(void *buf, u_int16_t len, struct iface *iface, struct nbr *nbr)
switch (iface->auth_type) {
case AUTH_SIMPLE:
- if (bcmp(ospf_hdr->auth_key.simple, iface->auth_key,
+ if (memcmp(ospf_hdr->auth_key.simple, iface->auth_key,
sizeof(ospf_hdr->auth_key.simple))) {
log_debug("auth_validate: wrong password, interface %s",
iface->name);
@@ -104,7 +104,7 @@ auth_validate(void *buf, u_int16_t len, struct iface *iface, struct nbr *nbr)
auth_data += ntohs(ospf_hdr->len);
/* save the received digest and clear it in the packet */
- bcopy(auth_data, recv_digest, sizeof(recv_digest));
+ memcpy(recv_digest, auth_data, sizeof(recv_digest));
bzero(auth_data, MD5_DIGEST_LENGTH);
/* insert plaintext key */
@@ -117,7 +117,7 @@ auth_validate(void *buf, u_int16_t len, struct iface *iface, struct nbr *nbr)
MD5Update(&hash, digest, MD5_DIGEST_LENGTH);
MD5Final(digest, &hash);
- if (bcmp(recv_digest, digest, sizeof(digest))) {
+ if (memcmp(recv_digest, digest, sizeof(digest))) {
log_debug("auth_validate: invalid MD5 digest, "
"interface %s", iface->name);
return (-1);
diff --git a/usr.sbin/ospfd/kroute.c b/usr.sbin/ospfd/kroute.c
index a146d95d7e1..07f401a7706 100644
--- a/usr.sbin/ospfd/kroute.c
+++ b/usr.sbin/ospfd/kroute.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: kroute.c,v 1.58 2008/06/13 07:05:26 claudio Exp $ */
+/* $OpenBSD: kroute.c,v 1.59 2008/07/24 18:46:59 claudio Exp $ */
/*
* Copyright (c) 2004 Esben Norby <norby@openbsd.org>
@@ -1284,7 +1284,7 @@ fetchifs(u_short ifindex)
continue;
switch (rtm->rtm_type) {
case RTM_IFINFO:
- bcopy(rtm, &ifm, sizeof ifm);
+ memcpy(&ifm, next, sizeof(ifm));
sa = (struct sockaddr *)(next + rtm->rtm_hdrlen);
get_rtaddrs(ifm.ifm_addrs, sa, rti_info);