Hello -

A few bcopy conversions to memcpy where the memory does not overlap,
otherwise memmove. 

OK?

Index: netinet/ip_ah.c
===================================================================
RCS file: /cvs/src/sys/netinet/ip_ah.c,v
retrieving revision 1.138
diff -u -p -r1.138 ip_ah.c
--- netinet/ip_ah.c     14 Mar 2018 22:38:46 -0000      1.138
+++ netinet/ip_ah.c     27 Mar 2018 16:10:03 -0000
@@ -899,8 +899,8 @@ ah_input_cb(struct cryptop *crp)
                         * mbuf...do an overlapping copy of the
                         * remainder of the mbuf over the ESP header.
                         */
-                       bcopy(mtod(m1, u_char *) + roff + rplen +
-                           ahx->authsize, mtod(m1, u_char *) + roff,
+                       memmove(mtod(m1, u_char *) + roff,
+                           mtod(m1, u_char *) + roff + rplen + ahx->authsize,
                            m1->m_len - (roff + rplen + ahx->authsize));
                        m1->m_len -= rplen + ahx->authsize;
                        m->m_pkthdr.len -= rplen + ahx->authsize;
Index: netinet/tcp_subr.c
===================================================================
RCS file: /cvs/src/sys/netinet/tcp_subr.c,v
retrieving revision 1.169
diff -u -p -r1.169 tcp_subr.c
--- netinet/tcp_subr.c  18 Mar 2018 21:05:21 -0000      1.169
+++ netinet/tcp_subr.c  27 Mar 2018 16:10:03 -0000
@@ -328,11 +328,11 @@ tcp_respond(struct tcpcb *tp, caddr_t te
                th = (struct tcphdr *)(ip6 + 1);
                tlen = sizeof(*ip6) + sizeof(*th);
                if (th0) {
-                       bcopy(template, ip6, sizeof(*ip6));
-                       bcopy(th0, th, sizeof(*th));
+                       memcpy(ip6, template, sizeof(*ip6));
+                       memcpy(th, th0, sizeof(*th));
                        xchg(ip6->ip6_dst, ip6->ip6_src, struct in6_addr);
                } else {
-                       bcopy(template, ip6, tlen);
+                       memcpy(ip6, template, tlen);
                }
                break;
 #endif /* INET6 */
@@ -341,11 +341,11 @@ tcp_respond(struct tcpcb *tp, caddr_t te
                th = (struct tcphdr *)(ip + 1);
                tlen = sizeof(*ip) + sizeof(*th);
                if (th0) {
-                       bcopy(template, ip, sizeof(*ip));
-                       bcopy(th0, th, sizeof(*th));
+                       memcpy(ip, template, sizeof(*ip));
+                       memcpy(th, th0, sizeof(*th));
                        xchg(ip->ip_dst.s_addr, ip->ip_src.s_addr, u_int32_t);
                } else {
-                       bcopy(template, ip, tlen);
+                       memcpy(ip, template, tlen);
                }
                break;
        }
@@ -952,7 +952,7 @@ tcp_signature_tdb_init(struct tdb *tdbp,
        tdbp->tdb_amxkey = malloc(ii->ii_authkeylen, M_XDATA, M_NOWAIT);
        if (tdbp->tdb_amxkey == NULL)
                return (ENOMEM);
-       bcopy(ii->ii_authkey, tdbp->tdb_amxkey, ii->ii_authkeylen);
+       memcpy(tdbp->tdb_amxkey, ii->ii_authkey, ii->ii_authkeylen);
        tdbp->tdb_amxkeylen = ii->ii_authkeylen;
 
        return (0);
Index: netinet/udp_usrreq.c
===================================================================
RCS file: /cvs/src/sys/netinet/udp_usrreq.c,v
retrieving revision 1.245
diff -u -p -r1.245 udp_usrreq.c
--- netinet/udp_usrreq.c        1 Dec 2017 10:33:33 -0000       1.245
+++ netinet/udp_usrreq.c        27 Mar 2018 16:10:03 -0000
@@ -295,8 +295,8 @@ udp_input(struct mbuf **mp, int *offp, i
                        }
 
                        /* remove the UDP header */
-                       bcopy(mtod(m, u_char *),
-                           mtod(m, u_char *) + sizeof(struct udphdr), iphlen);
+                       memmove(mtod(m, u_char *) + sizeof(struct udphdr),
+                           mtod(m, u_char *), iphlen);
                        m_adj(m, sizeof(struct udphdr));
                        skip -= sizeof(struct udphdr);
 

Reply via email to