-/* $OpenBSD: ip_esp.c,v 1.146 2017/02/07 18:18:16 bluhm Exp $ */
+/* $OpenBSD: ip_esp.c,v 1.147 2017/04/06 17:36:18 dhill Exp $ */
/*
* The authors of this code are John Ioannidis (ji@tla.org),
* Angelos D. Keromytis (kermit@csd.uch.gr) and
tc->tc_spi = tdb->tdb_spi;
tc->tc_proto = tdb->tdb_sproto;
tc->tc_rdomain = tdb->tdb_rdomain;
- memcpy(&tc->tc_dst, &tdb->tdb_dst, sizeof(union sockaddr_union));
+ tc->tc_dst = tdb->tdb_dst;
/* Decryption descriptor */
if (espx) {
* overlapping copy of the remainder of the mbuf over the ESP
* header.
*/
- bcopy(mtod(m1, u_char *) + roff + hlen,
- mtod(m1, u_char *) + roff, m1->m_len - (roff + hlen));
+ memmove(mtod(m1, u_char *) + roff,
+ mtod(m1, u_char *) + roff + hlen,
+ m1->m_len - (roff + hlen));
m1->m_len -= hlen;
m->m_pkthdr.len -= hlen;
}
}
/* Initialize ESP header. */
- bcopy((caddr_t) &tdb->tdb_spi, mtod(mo, caddr_t) + roff,
+ memcpy(mtod(mo, caddr_t) + roff, (caddr_t) &tdb->tdb_spi,
sizeof(u_int32_t));
tdb->tdb_rpl++;
replay = htonl((u_int32_t)tdb->tdb_rpl);
tc->tc_spi = tdb->tdb_spi;
tc->tc_proto = tdb->tdb_sproto;
tc->tc_rdomain = tdb->tdb_rdomain;
- memcpy(&tc->tc_dst, &tdb->tdb_dst, sizeof(union sockaddr_union));
+ tc->tc_dst = tdb->tdb_dst;
/* Crypto operation descriptor. */
crp->crp_ilen = m->m_pkthdr.len; /* Total input length. */
-/* $OpenBSD: ip_mroute.c,v 1.112 2017/03/17 14:59:29 rzalamena Exp $ */
+/* $OpenBSD: ip_mroute.c,v 1.113 2017/04/06 17:36:18 dhill Exp $ */
/* $NetBSD: ip_mroute.c,v 1.85 2004/04/26 01:31:57 matt Exp $ */
/*
*/
if (mrt_api_config & MRT_API_FLAGS_ALL) {
struct mfcctl2 *mp2 = mtod(m, struct mfcctl2 *);
- bcopy(mp2, (caddr_t)&mfcctl2, sizeof(*mp2));
+ memcpy((caddr_t)&mfcctl2, mp2, sizeof(*mp2));
} else {
struct mfcctl *mp = mtod(m, struct mfcctl *);
- bcopy(mp, (caddr_t)&mfcctl2, sizeof(*mp));
+ memcpy((caddr_t)&mfcctl2, mp, sizeof(*mp));
memset((caddr_t)&mfcctl2 + sizeof(struct mfcctl), 0,
sizeof(mfcctl2) - sizeof(struct mfcctl));
}
mp = mtod(m, struct mfcctl *);
- bcopy(mp, (caddr_t)&mfcctl2, sizeof(*mp));
+ memcpy((caddr_t)&mfcctl2, mp, sizeof(*mp));
memset((caddr_t)&mfcctl2 + sizeof(struct mfcctl), 0,
sizeof(mfcctl2) - sizeof(struct mfcctl));