From nobody Tue May 23 14:12:57 2023 X-Original-To: dev-commits-src-main@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4QQbrB0sFRz4CX78; Tue, 23 May 2023 14:12:58 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4QQbr972N9z41hS; Tue, 23 May 2023 14:12:57 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1684851178; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=nuNAfJix/D875H/4cTAn3noV0x4prFgxKh90aEuMXQQ=; b=SfxABdaGzbhycWQeDg3WeuibHVkDVdHInO/7NDQUVoTXftLF7irE0SQ1ci2w0JWIDxUTco ZKsSAvn2MA3SlEnOJl5CEJ98b30g8PvAS2dd64x6H90HAuOORUFGFkYpy0j3vCMXWR/dJd eefxBkEFyuT9TNVgiqrcUDECvyMJ0LNJmOh4bJI3OfZwaMNuhzDrTZTSRGQ8vW4SWAbwf1 naRXl9hTzLV8eD8za/r08EeMm2w1VxwGa+BhEwftR/vlKUB8SbVeJsLfrXqzBZsRRsy0jN GCC3O3PGwVvdg52TC7uNcgB8mnND4/8pdd5bRqaaTnqnUP+kJvxnhy9wu+1D5A== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1684851178; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=nuNAfJix/D875H/4cTAn3noV0x4prFgxKh90aEuMXQQ=; b=f9foawaLiaQK/JiDBdQJIq6IDIDrMFG3yb8F+JEwHmBFaYJ9ik5mGC1q/rdBqbeD92BrCV aQNjTYgDeoUv2ww86vcFiy2JLhbZD5IIqfs6T+sKTGAS8R+U9585bqZw2lMBqr2eONFHOV oaLuS/7kpvsERGakcS82i1VcYMVF2uU5ksThRhS4gz3mw758/ju8DrK6mwfFc5MAG+DNcL /GwPsf9HkbcvHOV5Yqec6MZBz6/3pinRPP9tbE4G0N3hVxpbNgq4lTpL4AK7GceMEgw1iE sxlR8NN7zQXPPK0Mmm75W+iCyY7qgyq1wwNM/tOQ7KUWIHy4X90ydu9PW/qyyw== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1684851178; a=rsa-sha256; cv=none; b=G51Mc/5RJ9dRT8S6sp44HvNKqMI3w6yl9vFlRH0h6jrJrZLJQqnXrJfk/xAFLf1xy++HLN wJenCzZYMqNPy+xJk49pV3V5cj5LgdzoVgscPvPP9g6M1I5Fdc+hi+rBns0zfwIUrFYdLA Mp0GzGyI1H76JwjwqJoohq3EGDN460wXt7R7VKAbpwYV96QcqeGGQdBbPHZHwzrHbu0Prg UP0gn6ZLQqnDA9H+ULZlrDvSnFq7afOGyJZdG9b+idM7OKSc+p5sHqTT2+GyUfH+sMsH/6 67q2h4M6nKLIS5YSeZnJHcUUzl2GgtiFcxSmCfa3ydJWvMpsMSC5biyhJW+uKA== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4QQbr965lyz13Ns; Tue, 23 May 2023 14:12:57 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 34NECvF5098667; Tue, 23 May 2023 14:12:57 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 34NECv5s098666; Tue, 23 May 2023 14:12:57 GMT (envelope-from git) Date: Tue, 23 May 2023 14:12:57 GMT Message-Id: <202305231412.34NECv5s098666@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Kristof Provost Subject: git: c4a32455d9cb - main - pf: remove the use of caddr_t List-Id: Commit messages for the main branch of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-main List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-src-main@freebsd.org X-BeenThere: dev-commits-src-main@freebsd.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: kp X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: c4a32455d9cb7f680964243341cfd0f2448eee64 Auto-Submitted: auto-generated X-ThisMailContainsUnwantedMimeParts: N The branch main has been updated by kp: URL: https://cgit.FreeBSD.org/src/commit/?id=c4a32455d9cb7f680964243341cfd0f2448eee64 commit c4a32455d9cb7f680964243341cfd0f2448eee64 Author: Kristof Provost AuthorDate: 2023-05-19 18:56:46 +0000 Commit: Kristof Provost CommitDate: 2023-05-23 14:11:13 +0000 pf: remove the use of caddr_t Replace caddr_t with void *, or more accurate types. Suggested by: glebius Reviewed by: zlei Differential Revision: https://reviews.freebsd.org/D40186 --- sys/net/pfvar.h | 6 +++--- sys/netpfil/pf/pf_ioctl.c | 4 ++-- sys/netpfil/pf/pf_norm.c | 4 ++-- 3 files changed, 7 insertions(+), 7 deletions(-) diff --git a/sys/net/pfvar.h b/sys/net/pfvar.h index e3e467500b94..4bdfa22b58ab 100644 --- a/sys/net/pfvar.h +++ b/sys/net/pfvar.h @@ -1704,7 +1704,7 @@ struct pfioc_state_kill { struct pfioc_states { int ps_len; union { - caddr_t ps_buf; + void *ps_buf; struct pfsync_state *ps_states; }; }; @@ -1713,7 +1713,7 @@ struct pfioc_states_v2 { int ps_len; uint64_t ps_req_version; union { - caddr_t ps_buf; + void *ps_buf; struct pf_state_export *ps_states; }; }; @@ -1721,7 +1721,7 @@ struct pfioc_states_v2 { struct pfioc_src_nodes { int psn_len; union { - caddr_t psn_buf; + void *psn_buf; struct pf_src_node *psn_src_nodes; }; }; diff --git a/sys/netpfil/pf/pf_ioctl.c b/sys/netpfil/pf/pf_ioctl.c index d5cea7d2a215..b71104a77996 100644 --- a/sys/netpfil/pf/pf_ioctl.c +++ b/sys/netpfil/pf/pf_ioctl.c @@ -1447,8 +1447,8 @@ pf_setup_pfsync_matching(struct pf_kruleset *rs) if (rs->rules[rs_cnt].inactive.rcount) { rs->rules[rs_cnt].inactive.ptr_array = - malloc(sizeof(caddr_t) * - rs->rules[rs_cnt].inactive.rcount, + mallocarray(rs->rules[rs_cnt].inactive.rcount, + sizeof(struct pf_rule **), M_TEMP, M_NOWAIT); if (!rs->rules[rs_cnt].inactive.ptr_array) diff --git a/sys/netpfil/pf/pf_norm.c b/sys/netpfil/pf/pf_norm.c index 8b267636751a..a902937c1253 100644 --- a/sys/netpfil/pf/pf_norm.c +++ b/sys/netpfil/pf/pf_norm.c @@ -883,7 +883,7 @@ pf_reassemble6(struct mbuf **m0, struct ip6_hdr *ip6, struct ip6_frag *fraghdr, /* Take protocol from first fragment header. */ m = m_getptr(m, hdrlen + offsetof(struct ip6_frag, ip6f_nxt), &off); KASSERT(m, ("%s: short mbuf chain", __func__)); - proto = *(mtod(m, caddr_t) + off); + proto = *(mtod(m, uint8_t *) + off); m = *m0; /* Delete frag6 header */ @@ -967,7 +967,7 @@ pf_refragment6(struct ifnet *ifp, struct mbuf **m0, struct m_tag *mtag, m = m_getptr(m, extoff + offsetof(struct ip6_ext, ip6e_nxt), &off); KASSERT((m != NULL), ("pf_refragment6: short mbuf chain")); - proto = *(mtod(m, caddr_t) + off); + proto = *(mtod(m, uint8_t *) + off); *(mtod(m, char *) + off) = IPPROTO_FRAGMENT; m = *m0; } else {