diff options
author | David Hill <dhill@cvs.openbsd.org> | 2017-04-06 02:11:09 +0000 |
---|---|---|
committer | David Hill <dhill@cvs.openbsd.org> | 2017-04-06 02:11:09 +0000 |
commit | be71528a93e3d4026ef3549be281bb786bd5ec4f (patch) | |
tree | 60acf812bdf4af8da61ffb6fba35bff40f8b38b5 /sys/netinet6/ip6_input.c | |
parent | ffc03db040049d5299d959cff0ac534fabebaccf (diff) |
Convert bcopy to memcpy as the memory does not overlap.
ok deraadt@
Diffstat (limited to 'sys/netinet6/ip6_input.c')
-rw-r--r-- | sys/netinet6/ip6_input.c | 10 |
1 files changed, 5 insertions, 5 deletions
diff --git a/sys/netinet6/ip6_input.c b/sys/netinet6/ip6_input.c index ac84ed1f413..20173d29804 100644 --- a/sys/netinet6/ip6_input.c +++ b/sys/netinet6/ip6_input.c @@ -1,4 +1,4 @@ -/* $OpenBSD: ip6_input.c,v 1.181 2017/03/06 08:59:07 mpi Exp $ */ +/* $OpenBSD: ip6_input.c,v 1.182 2017/04/06 02:11:08 dhill Exp $ */ /* $KAME: ip6_input.c,v 1.188 2001/03/29 05:34:31 itojun Exp $ */ /* @@ -777,7 +777,7 @@ ip6_process_hopopts(struct mbuf *m, u_int8_t *opthead, int hbhlen, return (-1); } optlen = IP6OPT_RTALERT_LEN; - bcopy((caddr_t)(opt + 2), (caddr_t)&rtalert_val, 2); + memcpy((caddr_t)&rtalert_val, (caddr_t)(opt + 2), 2); *rtalertp = ntohs(rtalert_val); break; case IP6OPT_JUMBO: @@ -810,9 +810,9 @@ ip6_process_hopopts(struct mbuf *m, u_int8_t *opthead, int hbhlen, /* * We may see jumbolen in unaligned location, so - * we'd need to perform bcopy(). + * we'd need to perform memcpy(). */ - bcopy(opt + 2, &jumboplen, sizeof(jumboplen)); + memcpy(&jumboplen, opt + 2, sizeof(jumboplen)); jumboplen = (u_int32_t)htonl(jumboplen); #if 1 @@ -935,7 +935,7 @@ ip6_savecontrol(struct inpcb *in6p, struct mbuf *m, struct mbuf **mp) /* RFC 2292 sec. 5 */ if ((in6p->inp_flags & IN6P_PKTINFO) != 0) { struct in6_pktinfo pi6; - bcopy(&ip6->ip6_dst, &pi6.ipi6_addr, sizeof(struct in6_addr)); + memcpy(&pi6.ipi6_addr, &ip6->ip6_dst, sizeof(struct in6_addr)); if (IN6_IS_SCOPE_EMBED(&pi6.ipi6_addr)) pi6.ipi6_addr.s6_addr16[1] = 0; pi6.ipi6_ifindex = m ? m->m_pkthdr.ph_ifidx : 0; |