From nobody Mon Dec 30 20:44:54 2024 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 4YMSlV4ht2z5j0J5; Mon, 30 Dec 2024 20:44:54 +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 4YMSlV2dckz4Hhq; Mon, 30 Dec 2024 20:44:54 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1735591494; 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=DEecFoDLJZNDDYsdZmSiHAncxQ4k8hcp/IfmixyjBNc=; b=P2GqrAyr1IL7pRlj7tydLKzK530gbG5ZxoJcAvi67JuxyAXiLOrtnJ0qhULeas4BsLS+cJ nrJa1OC4kfQw9Sly7lMGCRiLzp8wiBvmPKAFh5XwWXxTb+KCYT5G2pXRAqiGX215NXy2aq /2PEYQeQd1P5g6Cw4FXz2N6UcbItsap76AX156rWmOO5uUqDWKvlMlLlgqROddyhpb6Eh3 XNpjkNdd1C9ZJTUXg0Nl3uiiVSnDM3OqX7SFjyi/li4jbsCg/gnqVvRNjMfOqy+pIlASGH ftw4jnDhvycggdUcACIW8WEqRPwHEg14zs9JFDF6AqqutMVIP6wb3+Zz0as7Xw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1735591494; 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=DEecFoDLJZNDDYsdZmSiHAncxQ4k8hcp/IfmixyjBNc=; b=eeeW23sIG7iw5tYClWNY8CYGwNjdGp4kJkG+Vjl5Jzr17oRGEv2mpo2qjPixJihTqOAU0J yhhGSirsHdKRwK+ofiYVh3H/qLr8MMnRCHIFqRByqiz504ae8GpBIP1scoUg/hwI/QOMBT C98rqJ6CCB1d7JCO/UkB8H0njNeYK3AeWhchBd6R98z0HlEAyyptFOm8/ekXQ1X3wuM375 DkB1GRgrZhMg91z6HcpGB43+Y0+iPvfj3dr4xpkIBhDjQ3CR/kZbmaaL+hLlLVB3Xv0Orl 7bTfzynbK1pcTTr5w50hyUzpqXtOmr/H/DR/DJmEKnVDiaLyqoFtmS6qzMfmdA== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1735591494; a=rsa-sha256; cv=none; b=unEb1Ue6UN3241mf4jgTZ2swWqICkyPDTZJIBE+YQEJ8SdGgtM49culdNWuJx2Fl+56U5L HEjUFTKmYiM19QRJsexRnEJkRDhzhSTgtWATAzJuocFGhkl65YWlEjno2E9Kvyl7YMU5Tq fQxkSLvJm2U5toxpBE5SrtLicoz/CtYgazNs5v3TQatHvxgxfCIiDNHFA5mgO2iqRzLQH+ 3Lpx5eaEH10jBwaaEmCebYqZU/nRfkuPvUfgwHmECKtQN5KGbW/qIqDr50Q4eIN3XQf+N2 niRrFfp8pqVtY8EkayDJnewomUe2rVBIoJIdFWHw+EHEQoCyq2ZRR/fMqCXBdA== 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 4YMSlV1yHgz18hH; Mon, 30 Dec 2024 20:44:54 +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 4BUKisTU020147; Mon, 30 Dec 2024 20:44:54 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 4BUKisCi020144; Mon, 30 Dec 2024 20:44:54 GMT (envelope-from git) Date: Mon, 30 Dec 2024 20:44:54 GMT Message-Id: <202412302044.4BUKisCi020144@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: 07579e2110b3 - main - pf: sprinkle const over function arguments 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: X-BeenThere: dev-commits-src-main@freebsd.org Sender: owner-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: 07579e2110b3c00acafd1b692a3ce9a80fb3104b Auto-Submitted: auto-generated The branch main has been updated by kp: URL: https://cgit.FreeBSD.org/src/commit/?id=07579e2110b3c00acafd1b692a3ce9a80fb3104b commit 07579e2110b3c00acafd1b692a3ce9a80fb3104b Author: Kristof Provost AuthorDate: 2024-12-28 16:04:24 +0000 Commit: Kristof Provost CommitDate: 2024-12-30 20:42:13 +0000 pf: sprinkle const over function arguments Document that these are not supposed to modify their arguments. Sponsored by: Rubicon Communications, LLC ("Netgate") --- sys/net/pfvar.h | 10 +++++----- sys/netpfil/pf/pf.c | 10 +++++----- 2 files changed, 10 insertions(+), 10 deletions(-) diff --git a/sys/net/pfvar.h b/sys/net/pfvar.h index d22f715d6a27..3432f8dc99e1 100644 --- a/sys/net/pfvar.h +++ b/sys/net/pfvar.h @@ -2376,7 +2376,7 @@ VNET_DECLARE(struct ifnet *, sync_ifp); #define V_sync_ifp VNET(sync_ifp); VNET_DECLARE(struct pf_krule, pf_default_rule); #define V_pf_default_rule VNET(pf_default_rule) -extern void pf_addrcpy(struct pf_addr *, struct pf_addr *, +extern void pf_addrcpy(struct pf_addr *, const struct pf_addr *, sa_family_t); void pf_free_rule(struct pf_krule *); @@ -2417,10 +2417,10 @@ void pf_patch_16_unaligned(struct mbuf *, u_int16_t *, void *, u_int16_t, void pf_patch_32_unaligned(struct mbuf *, u_int16_t *, void *, u_int32_t, bool, u_int8_t); void pf_send_deferred_syn(struct pf_kstate *); -int pf_match_addr(u_int8_t, struct pf_addr *, struct pf_addr *, - struct pf_addr *, sa_family_t); -int pf_match_addr_range(struct pf_addr *, struct pf_addr *, - struct pf_addr *, sa_family_t); +int pf_match_addr(u_int8_t, const struct pf_addr *, + const struct pf_addr *, const struct pf_addr *, sa_family_t); +int pf_match_addr_range(const struct pf_addr *, const struct pf_addr *, + const struct pf_addr *, sa_family_t); int pf_match_port(u_int8_t, u_int16_t, u_int16_t, u_int16_t); void pf_normalize_init(void); diff --git a/sys/netpfil/pf/pf.c b/sys/netpfil/pf/pf.c index 761839715011..2a0dd2c3933a 100644 --- a/sys/netpfil/pf/pf.c +++ b/sys/netpfil/pf/pf.c @@ -774,7 +774,7 @@ pf_set_protostate(struct pf_kstate *s, int which, u_int8_t newstate) #ifdef INET6 void -pf_addrcpy(struct pf_addr *dst, struct pf_addr *src, sa_family_t af) +pf_addrcpy(struct pf_addr *dst, const struct pf_addr *src, sa_family_t af) { switch (af) { #ifdef INET @@ -4365,8 +4365,8 @@ pf_send_icmp(struct mbuf *m, u_int8_t type, u_int8_t code, sa_family_t af, * are different. */ int -pf_match_addr(u_int8_t n, struct pf_addr *a, struct pf_addr *m, - struct pf_addr *b, sa_family_t af) +pf_match_addr(u_int8_t n, const struct pf_addr *a, const struct pf_addr *m, + const struct pf_addr *b, sa_family_t af) { int match = 0; @@ -4401,8 +4401,8 @@ pf_match_addr(u_int8_t n, struct pf_addr *a, struct pf_addr *m, * Return 1 if b <= a <= e, otherwise return 0. */ int -pf_match_addr_range(struct pf_addr *b, struct pf_addr *e, - struct pf_addr *a, sa_family_t af) +pf_match_addr_range(const struct pf_addr *b, const struct pf_addr *e, + const struct pf_addr *a, sa_family_t af) { switch (af) { #ifdef INET