summaryrefslogtreecommitdiff
path: root/sys
diff options
context:
space:
mode:
authorDavid Hill <dhill@cvs.openbsd.org>2017-04-05 22:27:04 +0000
committerDavid Hill <dhill@cvs.openbsd.org>2017-04-05 22:27:04 +0000
commit972cfd83aa0001a3fbdd71ca99a0fc116d5d8310 (patch)
treef8a8b43f9dff2a9fa1f1fa7d4b9990711bbdd3c1 /sys
parentf26820aaea591a615c709f0118b493228125c172 (diff)
Replace 2 bcopy()'s with a simple assignment as both variables are
properly aligned malloc(9)d data and sockaddr_union fields. While here, convert the remaining bcopy() to memmove(). with and ok @bluhm
Diffstat (limited to 'sys')
-rw-r--r--sys/netinet/ip_ipcomp.c10
1 files changed, 5 insertions, 5 deletions
diff --git a/sys/netinet/ip_ipcomp.c b/sys/netinet/ip_ipcomp.c
index 75f9f0d6aa7..163f4d00002 100644
--- a/sys/netinet/ip_ipcomp.c
+++ b/sys/netinet/ip_ipcomp.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: ip_ipcomp.c,v 1.55 2017/02/17 14:49:03 bluhm Exp $ */
+/* $OpenBSD: ip_ipcomp.c,v 1.56 2017/04/05 22:27:03 dhill Exp $ */
/*
* Copyright (c) 2001 Jean-Jacques Bernard-Gundol (jj@wabbitt.org)
@@ -181,7 +181,7 @@ ipcomp_input(struct mbuf *m, struct tdb *tdb, int skip, int protoff)
tc->tc_spi = tdb->tdb_spi;
tc->tc_proto = IPPROTO_IPCOMP;
tc->tc_rdomain = tdb->tdb_rdomain;
- bcopy(&tdb->tdb_dst, &tc->tc_dst, sizeof(union sockaddr_union));
+ tc->tc_dst = tdb->tdb_dst;
return crypto_dispatch(crp);
}
@@ -317,8 +317,8 @@ ipcomp_input_cb(struct cryptop *crp)
/* Finally, let's relink */
m1->m_next = mo;
} else {
- bcopy(mtod(m1, u_char *) + roff + hlen,
- mtod(m1, u_char *) + roff,
+ 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;
@@ -501,7 +501,7 @@ ipcomp_output(struct mbuf *m, struct tdb *tdb, struct mbuf **mp, int skip,
tc->tc_proto = tdb->tdb_sproto;
tc->tc_skip = skip;
tc->tc_rdomain = tdb->tdb_rdomain;
- bcopy(&tdb->tdb_dst, &tc->tc_dst, sizeof(union sockaddr_union));
+ tc->tc_dst = tdb->tdb_dst;
/* Crypto operation descriptor */
crp->crp_ilen = m->m_pkthdr.len; /* Total input length */