bcopy -> memcpy. reviewed with one fix from matthew
authortedu <tedu@openbsd.org>
Tue, 31 Dec 2013 03:24:44 +0000 (03:24 +0000)
committertedu <tedu@openbsd.org>
Tue, 31 Dec 2013 03:24:44 +0000 (03:24 +0000)
sys/netinet/if_ether.c
sys/netinet/in.c
sys/netinet/ip_ether.c
sys/netinet/ip_gre.c
sys/netinet/ip_icmp.c
sys/netinet/ip_input.c

index a20420b..937e147 100644 (file)
@@ -1,4 +1,4 @@
-/*     $OpenBSD: if_ether.c,v 1.113 2013/11/27 12:25:30 mpi Exp $      */
+/*     $OpenBSD: if_ether.c,v 1.114 2013/12/31 03:24:44 tedu Exp $     */
 /*     $NetBSD: if_ether.c,v 1.31 1996/05/11 12:59:58 mycroft Exp $    */
 
 /*
@@ -310,19 +310,17 @@ arprequest(struct ifnet *ifp, u_int32_t *sip, u_int32_t *tip, u_int8_t *enaddr)
        ea = mtod(m, struct ether_arp *);
        eh = (struct ether_header *)sa.sa_data;
        bzero((caddr_t)ea, sizeof (*ea));
-       bcopy((caddr_t)etherbroadcastaddr, (caddr_t)eh->ether_dhost,
-           sizeof(eh->ether_dhost));
+       memcpy(eh->ether_dhost, etherbroadcastaddr, sizeof(eh->ether_dhost));
        eh->ether_type = htons(ETHERTYPE_ARP);  /* if_output will not swap */
        ea->arp_hrd = htons(ARPHRD_ETHER);
        ea->arp_pro = htons(ETHERTYPE_IP);
        ea->arp_hln = sizeof(ea->arp_sha);      /* hardware address length */
        ea->arp_pln = sizeof(ea->arp_spa);      /* protocol address length */
        ea->arp_op = htons(ARPOP_REQUEST);
-       bcopy((caddr_t)enaddr, (caddr_t)eh->ether_shost,
-             sizeof(eh->ether_shost));
-       bcopy((caddr_t)enaddr, (caddr_t)ea->arp_sha, sizeof(ea->arp_sha));
-       bcopy((caddr_t)sip, (caddr_t)ea->arp_spa, sizeof(ea->arp_spa));
-       bcopy((caddr_t)tip, (caddr_t)ea->arp_tpa, sizeof(ea->arp_tpa));
+       memcpy(eh->ether_shost, enaddr, sizeof(eh->ether_shost));
+       memcpy(ea->arp_sha, enaddr, sizeof(ea->arp_sha));
+       memcpy(ea->arp_spa, sip, sizeof(ea->arp_spa));
+       memcpy(ea->arp_tpa, tip, sizeof(ea->arp_tpa));
        sa.sa_family = pseudo_AF_HDRCMPLT;
        sa.sa_len = sizeof(sa);
        m->m_flags |= M_BCAST;
@@ -349,8 +347,7 @@ arpresolve(struct arpcom *ac, struct rtentry *rt, struct mbuf *m,
        char addr[INET_ADDRSTRLEN];
 
        if (m->m_flags & M_BCAST) {     /* broadcast */
-               bcopy((caddr_t)etherbroadcastaddr, (caddr_t)desten,
-                   sizeof(etherbroadcastaddr));
+               memcpy(desten, etherbroadcastaddr, sizeof(etherbroadcastaddr));
                return (1);
        }
        if (m->m_flags & M_MCAST) {     /* multicast */
@@ -384,7 +381,7 @@ arpresolve(struct arpcom *ac, struct rtentry *rt, struct mbuf *m,
         */
        if ((rt->rt_expire == 0 || rt->rt_expire > time_second) &&
            sdl->sdl_family == AF_LINK && sdl->sdl_alen != 0) {
-               bcopy(LLADDR(sdl), desten, sdl->sdl_alen);
+               memcpy(desten, LLADDR(sdl), sdl->sdl_alen);
                return 1;
        }
        if (((struct ifnet *)ac)->if_flags & IFF_NOARP) {
@@ -562,8 +559,8 @@ in_arpinput(struct mbuf *m)
        }
 #endif
 
-       bcopy((caddr_t)ea->arp_tpa, (caddr_t)&itaddr, sizeof(itaddr));
-       bcopy((caddr_t)ea->arp_spa, (caddr_t)&isaddr, sizeof(isaddr));
+       memcpy(&itaddr, ea->arp_tpa, sizeof(itaddr));
+       memcpy(&isaddr, ea->arp_spa, sizeof(isaddr));
 
        /* First try: check target against our addresses */
        TAILQ_FOREACH(ifa, &ifp->if_addrlist, ifa_list) {
@@ -693,8 +690,8 @@ in_arpinput(struct mbuf *m)
                            ac->ac_if.if_xname);
                        goto out;
                }
-               bcopy(ea->arp_sha, LLADDR(sdl),
-                   sdl->sdl_alen = sizeof(ea->arp_sha));
+               sdl->sdl_alen = sizeof(ea->arp_sha);
+               memcpy(LLADDR(sdl), ea->arp_sha, sizeof(ea->arp_sha));
                if (rt->rt_expire)
                        rt->rt_expire = time_second + arpt_keep;
                rt->rt_flags &= ~RTF_REJECT;
@@ -729,8 +726,8 @@ out:
        }
        if (itaddr.s_addr == myaddr.s_addr) {
                /* I am the target */
-               bcopy(ea->arp_sha, ea->arp_tha, sizeof(ea->arp_sha));
-               bcopy(enaddr, ea->arp_sha, sizeof(ea->arp_sha));
+               memcpy(ea->arp_tha, ea->arp_sha, sizeof(ea->arp_sha));
+               memcpy(ea->arp_sha, enaddr, sizeof(ea->arp_sha));
        } else {
                la = arplookup(itaddr.s_addr, 0, SIN_PROXY,
                    rtable_l2(m->m_pkthdr.rdomain));
@@ -739,22 +736,22 @@ out:
                rt = la->la_rt;
                if (rt->rt_ifp->if_type == IFT_CARP && ifp->if_type != IFT_CARP)
                        goto out;
-               bcopy(ea->arp_sha, ea->arp_tha, sizeof(ea->arp_sha));
+               memcpy(ea->arp_tha, ea->arp_sha, sizeof(ea->arp_sha));
                sdl = SDL(rt->rt_gateway);
-               bcopy(LLADDR(sdl), ea->arp_sha, sizeof(ea->arp_sha));
+               memcpy(ea->arp_sha, LLADDR(sdl), sizeof(ea->arp_sha));
        }
 
-       bcopy(ea->arp_spa, ea->arp_tpa, sizeof(ea->arp_spa));
-       bcopy(&itaddr, ea->arp_spa, sizeof(ea->arp_spa));
+       memcpy(ea->arp_tpa, ea->arp_spa, sizeof(ea->arp_spa));
+       memcpy(ea->arp_spa, &itaddr, sizeof(ea->arp_spa));
        ea->arp_op = htons(ARPOP_REPLY);
        ea->arp_pro = htons(ETHERTYPE_IP); /* let's be sure! */
        eh = (struct ether_header *)sa.sa_data;
-       bcopy(ea->arp_tha, eh->ether_dhost, sizeof(eh->ether_dhost));
+       memcpy(eh->ether_dhost, ea->arp_tha, sizeof(eh->ether_dhost));
 #if NCARP > 0
        if (ether_shost)
                enaddr = ether_shost;
 #endif
-       bcopy(enaddr, eh->ether_shost, sizeof(eh->ether_shost));
+       memcpy(eh->ether_shost, enaddr, sizeof(eh->ether_shost));
 
        eh->ether_type = htons(ETHERTYPE_ARP);
        sa.sa_family = pseudo_AF_HDRCMPLT;
@@ -950,10 +947,8 @@ in_revarpinput(struct mbuf *m)
        if (bcmp(ar->arp_tha, ((struct arpcom *)ifp)->ac_enaddr,
            sizeof(ar->arp_tha)))
                goto out;
-       bcopy((caddr_t)ar->arp_spa, (caddr_t)&revarp_srvip,
-           sizeof(revarp_srvip));
-       bcopy((caddr_t)ar->arp_tpa, (caddr_t)&revarp_myip,
-           sizeof(revarp_myip));
+       memcpy(&revarp_srvip, ar->arp_spa, sizeof(revarp_srvip));
+       memcpy(&revarp_myip, ar->arp_tpa, sizeof(revarp_myip));
        revarp_finished = 1;
 wake:  /* Do wakeup every time in case it was missed. */
        wakeup((caddr_t)&revarp_myip);
@@ -984,20 +979,16 @@ revarprequest(struct ifnet *ifp)
        ea = mtod(m, struct ether_arp *);
        eh = (struct ether_header *)sa.sa_data;
        bzero((caddr_t)ea, sizeof(*ea));
-       bcopy((caddr_t)etherbroadcastaddr, (caddr_t)eh->ether_dhost,
-           sizeof(eh->ether_dhost));
+       memcpy(eh->ether_dhost, etherbroadcastaddr, sizeof(eh->ether_dhost));
        eh->ether_type = htons(ETHERTYPE_REVARP);
        ea->arp_hrd = htons(ARPHRD_ETHER);
        ea->arp_pro = htons(ETHERTYPE_IP);
        ea->arp_hln = sizeof(ea->arp_sha);      /* hardware address length */
        ea->arp_pln = sizeof(ea->arp_spa);      /* protocol address length */
        ea->arp_op = htons(ARPOP_REVREQUEST);
-       bcopy((caddr_t)ac->ac_enaddr, (caddr_t)eh->ether_shost,
-          sizeof(ea->arp_tha));
-       bcopy((caddr_t)ac->ac_enaddr, (caddr_t)ea->arp_sha,
-          sizeof(ea->arp_sha));
-       bcopy((caddr_t)ac->ac_enaddr, (caddr_t)ea->arp_tha,
-          sizeof(ea->arp_tha));
+       memcpy(eh->ether_shost, ac->ac_enaddr, sizeof(ea->arp_tha));
+       memcpy(ea->arp_sha, ac->ac_enaddr, sizeof(ea->arp_sha));
+       memcpy(ea->arp_tha, ac->ac_enaddr, sizeof(ea->arp_tha));
        sa.sa_family = pseudo_AF_HDRCMPLT;
        sa.sa_len = sizeof(sa);
        m->m_flags |= M_BCAST;
@@ -1031,8 +1022,8 @@ revarpwhoarewe(struct ifnet *ifp, struct in_addr *serv_in,
        if (!revarp_finished)
                return ENETUNREACH;
 
-       bcopy((caddr_t)&revarp_srvip, serv_in, sizeof(*serv_in));
-       bcopy((caddr_t)&revarp_myip, clnt_in, sizeof(*clnt_in));
+       memcpy(serv_in, &revarp_srvip, sizeof(*serv_in));
+       memcpy(clnt_in, &revarp_myip, sizeof(*clnt_in));
        return 0;
 }
 
index d0bfeae..a12b241 100644 (file)
@@ -1,4 +1,4 @@
-/*     $OpenBSD: in.c,v 1.89 2013/11/28 10:16:44 mpi Exp $     */
+/*     $OpenBSD: in.c,v 1.90 2013/12/31 03:24:44 tedu Exp $    */
 /*     $NetBSD: in.c,v 1.26 1996/02/13 23:41:39 christos Exp $ */
 
 /*
@@ -494,15 +494,15 @@ in_lifaddr_ioctl(struct socket *so, u_long cmd, caddr_t data,
 
                /* copy args to in_aliasreq, perform ioctl(SIOCAIFADDR). */
                bzero(&ifra, sizeof(ifra));
-               bcopy(iflr->iflr_name, ifra.ifra_name,
-                       sizeof(ifra.ifra_name));
+               memcpy(ifra.ifra_name, iflr->iflr_name,
+                   sizeof(ifra.ifra_name));
 
-               bcopy(&iflr->addr, &ifra.ifra_addr,
-                       ((struct sockaddr *)&iflr->addr)->sa_len);
+               memcpy(&ifra.ifra_addr, &iflr->addr, 
+                   ((struct sockaddr *)&iflr->addr)->sa_len);
 
                if (((struct sockaddr *)&iflr->dstaddr)->sa_family) {   /*XXX*/
-                       bcopy(&iflr->dstaddr, &ifra.ifra_dstaddr,
-                               ((struct sockaddr *)&iflr->dstaddr)->sa_len);
+                       memcpy(&ifra.ifra_dstaddr, &iflr->dstaddr,
+                           ((struct sockaddr *)&iflr->dstaddr)->sa_len);
                }
 
                ifra.ifra_mask.sin_family = AF_INET;
@@ -563,11 +563,11 @@ in_lifaddr_ioctl(struct socket *so, u_long cmd, caddr_t data,
 
                if (cmd == SIOCGLIFADDR) {
                        /* fill in the if_laddrreq structure */
-                       bcopy(&ia->ia_addr, &iflr->addr, ia->ia_addr.sin_len);
+                       memcpy(&iflr->addr, &ia->ia_addr, ia->ia_addr.sin_len);
 
                        if ((ifp->if_flags & IFF_POINTOPOINT) != 0) {
-                               bcopy(&ia->ia_dstaddr, &iflr->dstaddr,
-                                       ia->ia_dstaddr.sin_len);
+                               memcpy(&iflr->dstaddr, &ia->ia_dstaddr,
+                                   ia->ia_dstaddr.sin_len);
                        } else
                                bzero(&iflr->dstaddr, sizeof(iflr->dstaddr));
 
@@ -582,17 +582,17 @@ in_lifaddr_ioctl(struct socket *so, u_long cmd, caddr_t data,
 
                        /* fill in_aliasreq and do ioctl(SIOCDIFADDR) */
                        bzero(&ifra, sizeof(ifra));
-                       bcopy(iflr->iflr_name, ifra.ifra_name,
-                               sizeof(ifra.ifra_name));
+                       memcpy(ifra.ifra_name, iflr->iflr_name,
+                           sizeof(ifra.ifra_name));
 
-                       bcopy(&ia->ia_addr, &ifra.ifra_addr,
-                               ia->ia_addr.sin_len);
+                       memcpy(&ifra.ifra_addr, &ia->ia_addr,
+                           ia->ia_addr.sin_len);
                        if ((ifp->if_flags & IFF_POINTOPOINT) != 0) {
-                               bcopy(&ia->ia_dstaddr, &ifra.ifra_dstaddr,
-                                       ia->ia_dstaddr.sin_len);
+                               memcpy(&ifra.ifra_dstaddr, &ia->ia_dstaddr,
+                                   ia->ia_dstaddr.sin_len);
                        }
-                       bcopy(&ia->ia_sockmask, &ifra.ifra_dstaddr,
-                               ia->ia_sockmask.sin_len);
+                       memcpy(&ifra.ifra_dstaddr, &ia->ia_sockmask,
+                           ia->ia_sockmask.sin_len);
 
                        return in_control(so, SIOCDIFADDR, (caddr_t)&ifra, ifp);
                }
index f53041e..d7b94be 100644 (file)
@@ -1,4 +1,4 @@
-/*     $OpenBSD: ip_ether.c,v 1.63 2013/11/06 17:08:57 deraadt Exp $  */
+/*     $OpenBSD: ip_ether.c,v 1.64 2013/12/31 03:24:44 tedu Exp $  */
 /*
  * The author of this code is Angelos D. Keromytis (kermit@adk.gr)
  *
@@ -513,7 +513,7 @@ etherip_output(struct mbuf *m, struct tdb *tdb, struct mbuf **mp, int proto)
                if (M_LEADINGSPACE(m) < off)
                        panic("etherip_output: no space for align fixup");
                m->m_data -= off;
-               bcopy(mtod(m, caddr_t) + off, mtod(m, caddr_t), m->m_len);
+               memmove(mtod(m, caddr_t), mtod(m, caddr_t) + off, m->m_len);
        }
 
        /* Statistics */
index f012de9..2b2c183 100644 (file)
@@ -1,4 +1,4 @@
-/*      $OpenBSD: ip_gre.c,v 1.47 2013/10/24 11:31:43 mpi Exp $ */
+/*      $OpenBSD: ip_gre.c,v 1.48 2013/12/31 03:24:44 tedu Exp $ */
 /*     $NetBSD: ip_gre.c,v 1.9 1999/10/25 19:18:11 drochner Exp $ */
 
 /*
@@ -327,7 +327,7 @@ gre_mobile_input(struct mbuf *m, ...)
                return;
        }
 
-       bcopy(ip + (ip->ip_hl << 2) + msiz, ip + (ip->ip_hl << 2),
+       memmove(ip + (ip->ip_hl << 2), ip + (ip->ip_hl << 2) + msiz, 
              m->m_len - msiz - (ip->ip_hl << 2));
 
        m->m_len -= msiz;
index b8da8bb..a04f979 100644 (file)
@@ -1,4 +1,4 @@
-/*     $OpenBSD: ip_icmp.c,v 1.111 2013/11/26 11:27:41 henning Exp $   */
+/*     $OpenBSD: ip_icmp.c,v 1.112 2013/12/31 03:24:44 tedu Exp $      */
 /*     $NetBSD: ip_icmp.c,v 1.19 1996/02/13 23:42:22 christos Exp $    */
 
 /*
@@ -609,9 +609,9 @@ reflect:
                bzero(&ssrc, sizeof(ssrc));
                sdst.sin_family = sgw.sin_family = ssrc.sin_family = AF_INET;
                sdst.sin_len = sgw.sin_len = ssrc.sin_len = sizeof(sdst);
-               bcopy(&icp->icmp_ip.ip_dst, &sdst.sin_addr, sizeof(sdst));
-               bcopy(&icp->icmp_gwaddr, &sgw.sin_addr, sizeof(sgw));
-               bcopy(&ip->ip_src, &ssrc.sin_addr, sizeof(ssrc));
+               memcpy(&sdst.sin_addr, &icp->icmp_ip.ip_dst, sizeof(sdst));
+               memcpy(&sgw.sin_addr, &icp->icmp_gwaddr, sizeof(sgw));
+               memcpy(&ssrc.sin_addr, &ip->ip_src, sizeof(ssrc));
 
 #ifdef ICMPPRINTFS
                if (icmpprintfs) {
@@ -789,9 +789,8 @@ icmp_reflect(struct mbuf *m, struct mbuf **op, struct in_ifaddr *ia)
                                 */
                                if (opt == IPOPT_RR || opt == IPOPT_TS ||
                                    opt == IPOPT_SECURITY) {
-                                       bcopy((caddr_t)cp,
-                                           mtod(opts, caddr_t) + opts->m_len,
-                                           len);
+                                       memcpy(mtod(opts, caddr_t) +
+                                           opts->m_len, cp, len);
                                        opts->m_len += len;
                                }
                        }
index 6086893..cb17cf8 100644 (file)
@@ -1,4 +1,4 @@
-/*     $OpenBSD: ip_input.c,v 1.222 2013/11/27 08:34:39 mpi Exp $      */
+/*     $OpenBSD: ip_input.c,v 1.223 2013/12/31 03:24:44 tedu Exp $     */
 /*     $NetBSD: ip_input.c,v 1.30 1996/03/16 23:53:58 christos Exp $   */
 
 /*
@@ -1090,7 +1090,7 @@ ip_dooptions(struct mbuf *m)
                        /*
                         * locate outgoing interface
                         */
-                       bcopy((caddr_t)(cp + off), (caddr_t)&ipaddr.sin_addr,
+                       memcpy(&ipaddr.sin_addr, cp + off,
                            sizeof(ipaddr.sin_addr));
                        if (opt == IPOPT_SSRR) {
                            if ((ia = ifatoia(ifa_ifwithdstaddr(sintosa(&ipaddr),
@@ -1107,8 +1107,8 @@ ip_dooptions(struct mbuf *m)
                                goto bad;
                        }
                        ip->ip_dst = ipaddr.sin_addr;
-                       bcopy((caddr_t)&ia->ia_addr.sin_addr,
-                           (caddr_t)(cp + off), sizeof(struct in_addr));
+                       memcpy(cp + off, &ia->ia_addr.sin_addr,
+                           sizeof(struct in_addr));
                        cp[IPOPT_OFFSET] += sizeof(struct in_addr);
                        /*
                         * Let ip_intr's mcast routing check handle mcast pkts
@@ -1132,7 +1132,7 @@ ip_dooptions(struct mbuf *m)
                        off--;                  /* 0 origin */
                        if ((off + sizeof(struct in_addr)) > optlen)
                                break;
-                       bcopy((caddr_t)(&ip->ip_dst), (caddr_t)&ipaddr.sin_addr,
+                       memcpy(&ipaddr.sin_addr, &ip->ip_dst,
                            sizeof(ipaddr.sin_addr));
                        /*
                         * locate outgoing interface; if we're the destination,
@@ -1147,8 +1147,8 @@ ip_dooptions(struct mbuf *m)
                                code = ICMP_UNREACH_HOST;
                                goto bad;
                        }
-                       bcopy((caddr_t)&ia->ia_addr.sin_addr,
-                           (caddr_t)(cp + off), sizeof(struct in_addr));
+                       memcpy(cp + off, &ia->ia_addr.sin_addr,
+                           sizeof(struct in_addr));
                        cp[IPOPT_OFFSET] += sizeof(struct in_addr);
                        break;
 
@@ -1156,7 +1156,7 @@ ip_dooptions(struct mbuf *m)
                        code = cp - (u_char *)ip;
                        if (optlen < sizeof(struct ip_timestamp))
                                goto bad;
-                       bcopy(cp, &ipt, sizeof(struct ip_timestamp));
+                       memcpy(&ipt, cp, sizeof(struct ip_timestamp));
                        if (ipt.ipt_ptr < 5 || ipt.ipt_len < 5)
                                goto bad;
                        if (ipt.ipt_ptr - 1 + sizeof(n_time) > ipt.ipt_len) {
@@ -1164,7 +1164,7 @@ ip_dooptions(struct mbuf *m)
                                        goto bad;
                                break;
                        }
-                       bcopy(cp + ipt.ipt_ptr - 1, &sin, sizeof sin);
+                       memcpy(&sin, cp + ipt.ipt_ptr - 1, sizeof sin);
                        switch (ipt.ipt_flg) {
 
                        case IPOPT_TS_TSONLY:
@@ -1179,8 +1179,8 @@ ip_dooptions(struct mbuf *m)
                                    m->m_pkthdr.rcvif));
                                if (ia == 0)
                                        continue;
-                               bcopy((caddr_t)&ia->ia_addr.sin_addr,
-                                   (caddr_t)&sin, sizeof(struct in_addr));
+                               memcpy(&sin, &ia->ia_addr.sin_addr,
+                                   sizeof(struct in_addr));
                                ipt.ipt_ptr += sizeof(struct in_addr);
                                break;
 
@@ -1188,7 +1188,7 @@ ip_dooptions(struct mbuf *m)
                                if (ipt.ipt_ptr - 1 + sizeof(n_time) +
                                    sizeof(struct in_addr) > ipt.ipt_len)
                                        goto bad;
-                               bcopy((caddr_t)&sin, (caddr_t)&ipaddr.sin_addr,
+                               memcpy(&ipaddr.sin_addr, &sin,
                                    sizeof(struct in_addr));
                                if (ifa_ifwithaddr(sintosa(&ipaddr),
                                    m->m_pkthdr.rdomain) == 0)
@@ -1203,8 +1203,7 @@ ip_dooptions(struct mbuf *m)
                                goto bad;
                        }
                        ntime = iptime();
-                       bcopy((caddr_t)&ntime, (caddr_t)cp + ipt.ipt_ptr - 1,
-                           sizeof(n_time));
+                       memcpy(cp + ipt.ipt_ptr - 1, &ntime, sizeof(n_time));
                        ipt.ipt_ptr += sizeof(n_time);
                }
        }
@@ -1267,7 +1266,7 @@ save_rte(struct mbuf *m, u_char *option, struct in_addr dst)
                return;
        isr = (struct ip_srcrt *)(mtag + 1);
 
-       bcopy(option, isr->isr_hdr, olen);
+       memcpy(isr->isr_hdr, option, olen);
        isr->isr_nhops = (olen - IPOPT_OFFSET - 1) / sizeof(struct in_addr);
        isr->isr_dst = dst;
        m_tag_prepend(m, mtag);
@@ -1316,7 +1315,8 @@ ip_srcroute(struct mbuf *m0)
         */
        isr->isr_nop = IPOPT_NOP;
        isr->isr_hdr[IPOPT_OFFSET] = IPOPT_MINOFF;
-       bcopy(&isr->isr_nop, mtod(m, caddr_t) + sizeof(struct in_addr), OPTSIZ);
+       memcpy(mtod(m, caddr_t) + sizeof(struct in_addr), &isr->isr_nop,
+           OPTSIZ);
        q = (struct in_addr *)(mtod(m, caddr_t) +
            sizeof(struct in_addr) + OPTSIZ);
 #undef OPTSIZ
@@ -1349,7 +1349,7 @@ ip_stripoptions(struct mbuf *m)
        olen = (ip->ip_hl<<2) - sizeof (struct ip);
        opts = (caddr_t)(ip + 1);
        i = m->m_len - (sizeof (struct ip) + olen);
-       bcopy(opts  + olen, opts, (unsigned)i);
+       memmove(opts, opts  + olen, i);
        m->m_len -= olen;
        if (m->m_flags & M_PKTHDR)
                m->m_pkthdr.len -= olen;