From 171085cb8f3fba42318035abf936bd26ad14a570 Mon Sep 17 00:00:00 2001 From: claudio Date: Thu, 24 Jul 2008 18:46:59 +0000 Subject: [PATCH] Use memcpy() and memcmp() like everywhere else in ospfd. OK norby@ --- usr.sbin/ospfd/auth.c | 8 ++++---- usr.sbin/ospfd/kroute.c | 4 ++-- 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 @@ -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 @@ -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); -- 2.20.1