Hello -

The following diff removes bcopy from ip6_input.c and mld6.c by using
memcpy as the memory does not overlap.

OK?

Index: ip6_input.c
===================================================================
RCS file: /cvs/src/sys/netinet6/ip6_input.c,v
retrieving revision 1.181
diff -u -p -r1.181 ip6_input.c
--- ip6_input.c 6 Mar 2017 08:59:07 -0000       1.181
+++ ip6_input.c 6 Apr 2017 00:50:46 -0000
@@ -777,7 +777,7 @@ ip6_process_hopopts(struct mbuf *m, u_in
                                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_in
 
                        /*
                         * 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, stru
        /* 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;
Index: mld6.c
===================================================================
RCS file: /cvs/src/sys/netinet6/mld6.c,v
retrieving revision 1.50
diff -u -p -r1.50 mld6.c
--- mld6.c      9 Feb 2017 15:23:35 -0000       1.50
+++ mld6.c      6 Apr 2017 00:50:46 -0000
@@ -109,7 +109,7 @@ mld6_init(void)
        hbh_buf[3] = 0;
        hbh_buf[4] = IP6OPT_ROUTER_ALERT;
        hbh_buf[5] = IP6OPT_RTALERT_LEN - 2;
-       bcopy((caddr_t)&rtalert_code, &hbh_buf[6], sizeof(u_int16_t));
+       memcpy(&hbh_buf[6], (caddr_t)&rtalert_code, sizeof(u_int16_t));
 
        ip6_opts.ip6po_hbh = hbh;
 }

Reply via email to