The branch main has been updated by kp:

URL: 
https://cgit.FreeBSD.org/src/commit/?id=9a1b591a862dbb65231f8c8a6900957e3f99b686

commit 9a1b591a862dbb65231f8c8a6900957e3f99b686
Author:     Kristof Provost <k...@freebsd.org>
AuthorDate: 2025-02-11 13:20:46 +0000
Commit:     Kristof Provost <k...@freebsd.org>
CommitDate: 2025-02-19 10:41:08 +0000

    pf: bcopy -> memcpy
    
    impossibility of overlaps verified. ok benno dlg
    
    Obtained from:  OpenBSD, henning <henn...@openbsd.org>, 47d085d437
    Sponsored by:   Rubicon Communications, LLC ("Netgate")
---
 sys/netpfil/pf/pf.c       | 6 +++---
 sys/netpfil/pf/pf_ioctl.c | 2 +-
 2 files changed, 4 insertions(+), 4 deletions(-)

diff --git a/sys/netpfil/pf/pf.c b/sys/netpfil/pf/pf.c
index 5e5bd744343c..ea5687407881 100644
--- a/sys/netpfil/pf/pf.c
+++ b/sys/netpfil/pf/pf.c
@@ -4043,7 +4043,7 @@ pf_build_tcp(const struct pf_krule *r, sa_family_t af,
                opt[0] = TCPOPT_MAXSEG;
                opt[1] = 4;
                HTONS(mss);
-               bcopy((caddr_t)&mss, (caddr_t)(opt + 2), 2);
+               memcpy((opt + 2), &mss, 2);
        }
 
        switch (af) {
@@ -4998,7 +4998,7 @@ pf_get_mss(struct pf_pdesc *pd)
                        --hlen;
                        break;
                case TCPOPT_MAXSEG:
-                       bcopy((caddr_t)(opt + 2), (caddr_t)&mss, 2);
+                       memcpy(&mss, (opt + 2), 2);
                        NTOHS(mss);
                        /* FALLTHROUGH */
                default:
@@ -6061,7 +6061,7 @@ pf_create_state(struct pf_krule *r, struct pf_krule *nr, 
struct pf_krule *a,
        s->rule = r;
        s->nat_rule = nr;
        s->anchor = a;
-       bcopy(match_rules, &s->match_rules, sizeof(s->match_rules));
+       memcpy(&s->match_rules, match_rules, sizeof(s->match_rules));
        memcpy(&s->act, &pd->act, sizeof(struct pf_rule_actions));
 
        STATE_INC_COUNTERS(s);
diff --git a/sys/netpfil/pf/pf_ioctl.c b/sys/netpfil/pf/pf_ioctl.c
index 6553981a1059..c8447b4e64b8 100644
--- a/sys/netpfil/pf/pf_ioctl.c
+++ b/sys/netpfil/pf/pf_ioctl.c
@@ -5733,7 +5733,7 @@ pf_state_export(struct pf_state_export *sp, struct 
pf_kstate *st)
        strlcpy(sp->ifname, st->kif->pfik_name, sizeof(sp->ifname));
        strlcpy(sp->orig_ifname, st->orig_kif->pfik_name,
            sizeof(sp->orig_ifname));
-       bcopy(&st->act.rt_addr, &sp->rt_addr, sizeof(sp->rt_addr));
+       memcpy(&sp->rt_addr, &st->act.rt_addr, sizeof(sp->rt_addr));
        sp->creation = htonl(time_uptime - (st->creation / 1000));
        sp->expire = pf_state_expires(st);
        if (sp->expire <= time_uptime)

Reply via email to