From nobody Tue Aug 27 14:46:11 2024 X-Original-To: dev-commits-src-all@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 4WtVjH3bwWz52H5J; Tue, 27 Aug 2024 14:46:11 +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 "R11" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4WtVjH2xFMz49vQ; Tue, 27 Aug 2024 14:46:11 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1724769971; 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=u4XucBQdI/edCK0upoywZI5rriC4MWFijHj3+TLcHtc=; b=e+kCKWCIib8Wxe0q/0EQISwDI4Rxf2/caXd/9pUjV/BzG2nEqePMojyj+RH+5xB+TTWO0x hj9o0O1fn5MzUZ6FxDoDw8YtWMcoHT+LUugIM9MiqF2538qNrwXtpWbnrMHGFJi65Bf68P o21fj/GWkoGihK4cy8ldO8d+Zpf8sozApeYEb/EMzxBuK8urkQkqxNGjzPanGJ9aL7kL1W JSepwOlGO2H2BkrHR+GUsG8ONI2FVPZHsyPY6uzxoiNI9Pf9EK0E2k36la1ZnxNKV2jcqR QZjUNKHi3q9YVur43OB/D7jGqQ5sdlB5/c1M/Foi8DVEx9EaLWTdcuqlFqYm3A== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1724769971; a=rsa-sha256; cv=none; b=W9EIlrNi3B9e/A9SZ3VNNYWr5OJYLwl/KB63HuY4+sS0Pe6U8QujhC66hU09M0Ujt+GyXa jd0y0lSbTd5Pt4mLst5ClvXKHdekVpJknjR/FqSW5odbzhXcHR0hVoidSVjUnQEP8dUiEy xL52xGy/ONQJlqOJOfd/iu5hgbuNTZSJUMKJboNwpDMmBGBdoUPRQMhUdckXKmaZ3ZdoG8 NpFJU44uWUXB+MfpvQUhG626U9zAVlkafxkIPdoOhCRsnSflwt6NOg76je+0D9pVIiZXYi Z+xtlrNrWBfNyL6d9EFKLIPQFLNIwnqyCdcYaoTq1Aub7BDgwyaNC7yjIZ0pCQ== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1724769971; 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=u4XucBQdI/edCK0upoywZI5rriC4MWFijHj3+TLcHtc=; b=EYpALI3qU2rfk0kpgxeUDw9XY8XYbMkJnc+/yN08Jfaa2zV2SnccIsETNMjs/p6a5dfnFm 2tgNeZ3XswhB6YF1q0T06YX1s0Ppco/zWt64MpAM9T8vQER2SoYTbEh493y8NCEwzbNQWS lCLhPRdRNcxzud7iV7saME+HqN2fgI3mbf7P7vI/80E/b1KsCw3ge4OLjPzVfULMaKOKDb 4Nlu6E94Ec5c2wwvptJhqcZztH+6kPr1mDT4wnFfe7iH0Eyb3Vox72VTvvismAFQ2vVASV TVVszTd8KGWH0fvoDK7njYbavyPubrodzNrPTZ5meKhKOgByjqYms6eOzxlmpA== 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 4WtVjH2XbrztxN; Tue, 27 Aug 2024 14:46:11 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.18.1/8.18.1) with ESMTP id 47REkBY6053384; Tue, 27 Aug 2024 14:46:11 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 47REkBfW053381; Tue, 27 Aug 2024 14:46:11 GMT (envelope-from git) Date: Tue, 27 Aug 2024 14:46:11 GMT Message-Id: <202408271446.47REkBfW053381@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: 2096ad13524e - main - pf: sprinkle const in pf_pull_hdr() List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-all@freebsd.org Sender: owner-dev-commits-src-all@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: 2096ad13524e5bc6ace98877dd62583ba1ec3f82 Auto-Submitted: auto-generated The branch main has been updated by kp: URL: https://cgit.FreeBSD.org/src/commit/?id=2096ad13524e5bc6ace98877dd62583ba1ec3f82 commit 2096ad13524e5bc6ace98877dd62583ba1ec3f82 Author: Kristof Provost AuthorDate: 2024-08-26 17:08:04 +0000 Commit: Kristof Provost CommitDate: 2024-08-27 14:45:46 +0000 pf: sprinkle const in pf_pull_hdr() Sponsored by: Rubicon Communications, LLC ("Netgate") --- sys/net/pfvar.h | 2 +- sys/netpfil/pf/pf.c | 6 +++--- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/sys/net/pfvar.h b/sys/net/pfvar.h index d66e6f799761..10bf527c025d 100644 --- a/sys/net/pfvar.h +++ b/sys/net/pfvar.h @@ -2329,7 +2329,7 @@ int pf_multihome_scan_asconf(struct mbuf *, int, int, struct pf_pdesc *, struct pfi_kkif *); u_int32_t pf_new_isn(struct pf_kstate *); -void *pf_pull_hdr(struct mbuf *, int, void *, int, u_short *, u_short *, +void *pf_pull_hdr(const struct mbuf *, int, void *, int, u_short *, u_short *, sa_family_t); void pf_change_a(void *, u_int16_t *, u_int32_t, u_int8_t); void pf_change_proto_a(struct mbuf *, void *, u_int16_t *, u_int32_t, diff --git a/sys/netpfil/pf/pf.c b/sys/netpfil/pf/pf.c index cb69d06b1fe6..acbaf304995f 100644 --- a/sys/netpfil/pf/pf.c +++ b/sys/netpfil/pf/pf.c @@ -7422,13 +7422,13 @@ pf_test_state_other(struct pf_kstate **state, struct pfi_kkif *kif, * h must be at "ipoff" on the mbuf chain. */ void * -pf_pull_hdr(struct mbuf *m, int off, void *p, int len, +pf_pull_hdr(const struct mbuf *m, int off, void *p, int len, u_short *actionp, u_short *reasonp, sa_family_t af) { switch (af) { #ifdef INET case AF_INET: { - struct ip *h = mtod(m, struct ip *); + const struct ip *h = mtod(m, struct ip *); u_int16_t fragoff = (ntohs(h->ip_off) & IP_OFFMASK) << 3; if (fragoff) { @@ -7451,7 +7451,7 @@ pf_pull_hdr(struct mbuf *m, int off, void *p, int len, #endif /* INET */ #ifdef INET6 case AF_INET6: { - struct ip6_hdr *h = mtod(m, struct ip6_hdr *); + const struct ip6_hdr *h = mtod(m, struct ip6_hdr *); if (m->m_pkthdr.len < off + len || (ntohs(h->ip6_plen) + sizeof(struct ip6_hdr)) <