git: b450a0f928d6 - main - pf: remove unneeded double pointer to pf_scrub_ip(6)()

From: Kristof Provost <kp_at_FreeBSD.org>
Date: Thu, 19 Sep 2024 20:21:25 UTC
The branch main has been updated by kp:

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

commit b450a0f928d640f823ba31779cd492e7d5d1c38c
Author:     Kristof Provost <kp@FreeBSD.org>
AuthorDate: 2024-09-04 15:19:44 +0000
Commit:     Kristof Provost <kp@FreeBSD.org>
CommitDate: 2024-09-19 20:20:14 +0000

    pf: remove unneeded double pointer to pf_scrub_ip(6)()
    
    pf_scrub_ip() does not modify the given mbuf pointer.  So don't
    pass a pointer to a pointer to make the code in pf_test() clearer.
    ok henning@
    
    Reviewed by:    zlei
    Obtained from:  OpenBSD, bluhm <bluhm@openbsd.org>, aac78b59b9
    Sponsored by:   Rubicon Communications, LLC ("Netgate")
    Differential Revision:  https://reviews.freebsd.org/D46593
---
 sys/net/pfvar.h          | 4 ++--
 sys/netpfil/pf/pf.c      | 4 ++--
 sys/netpfil/pf/pf_norm.c | 6 ++----
 3 files changed, 6 insertions(+), 8 deletions(-)

diff --git a/sys/net/pfvar.h b/sys/net/pfvar.h
index 9a0130dbf487..8335fbfaedb8 100644
--- a/sys/net/pfvar.h
+++ b/sys/net/pfvar.h
@@ -2641,10 +2641,10 @@ void			 pf_rule_to_actions(struct pf_krule *,
 int			 pf_normalize_mss(struct mbuf *m, int off,
 			    struct pf_pdesc *pd);
 #ifdef INET
-void	pf_scrub_ip(struct mbuf **, struct pf_pdesc *);
+void	pf_scrub_ip(struct mbuf *, struct pf_pdesc *);
 #endif	/* INET */
 #ifdef INET6
-void	pf_scrub_ip6(struct mbuf **, struct pf_pdesc *);
+void	pf_scrub_ip6(struct mbuf *, struct pf_pdesc *);
 #endif	/* INET6 */
 
 struct pfi_kkif		*pf_kkif_create(int);
diff --git a/sys/netpfil/pf/pf.c b/sys/netpfil/pf/pf.c
index c85c2e784cd9..916657c7af15 100644
--- a/sys/netpfil/pf/pf.c
+++ b/sys/netpfil/pf/pf.c
@@ -9221,7 +9221,7 @@ done:
 		REASON_SET(&reason, PFRES_MEMORY);
 	}
 
-	pf_scrub_ip(&m, &pd);
+	pf_scrub_ip(m, &pd);
 	if (pd.proto == IPPROTO_TCP && pd.act.max_mss)
 		pf_normalize_mss(m, off, &pd);
 
@@ -9676,7 +9676,7 @@ done:
 		REASON_SET(&reason, PFRES_MEMORY);
 	}
 
-	pf_scrub_ip6(&m, &pd);
+	pf_scrub_ip6(m, &pd);
 	if (pd.proto == IPPROTO_TCP && pd.act.max_mss)
 		pf_normalize_mss(m, off, &pd);
 
diff --git a/sys/netpfil/pf/pf_norm.c b/sys/netpfil/pf/pf_norm.c
index aaeb027ca8bd..8bc9bb4914db 100644
--- a/sys/netpfil/pf/pf_norm.c
+++ b/sys/netpfil/pf/pf_norm.c
@@ -2269,9 +2269,8 @@ sctp_drop:
 
 #ifdef INET
 void
-pf_scrub_ip(struct mbuf **m0, struct pf_pdesc *pd)
+pf_scrub_ip(struct mbuf *m, struct pf_pdesc *pd)
 {
-	struct mbuf		*m = *m0;
 	struct ip		*h = mtod(m, struct ip *);
 
 	/* Clear IP_DF if no-df was requested */
@@ -2313,9 +2312,8 @@ pf_scrub_ip(struct mbuf **m0, struct pf_pdesc *pd)
 
 #ifdef INET6
 void
-pf_scrub_ip6(struct mbuf **m0, struct pf_pdesc *pd)
+pf_scrub_ip6(struct mbuf *m, struct pf_pdesc *pd)
 {
-	struct mbuf		*m = *m0;
 	struct ip6_hdr		*h = mtod(m, struct ip6_hdr *);
 
 	/* Enforce a minimum ttl, may cause endless packet loops */