git: 2e9e8fc320fc - stable/12 - ipfilter: Fix IP header checksums post ftp proxy

From: Cy Schubert <cy_at_FreeBSD.org>
Date: Wed, 19 Jan 2022 14:23:48 UTC
The branch stable/12 has been updated by cy:

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

commit 2e9e8fc320fca3b4a8207c72111e596f1b67a764
Author:     Cy Schubert <cy@FreeBSD.org>
AuthorDate: 2022-01-12 20:55:11 +0000
Commit:     Cy Schubert <cy@FreeBSD.org>
CommitDate: 2022-01-19 14:23:16 +0000

    ipfilter: Fix IP header checksums post ftp proxy
    
    Don't assume checksums will be calculated later in fastforward.
    
    (cherry picked from commit 2a6465245fa3f5323c2036049a730e2f2b95d270)
---
 sys/contrib/ipfilter/netinet/ip_proxy.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/sys/contrib/ipfilter/netinet/ip_proxy.c b/sys/contrib/ipfilter/netinet/ip_proxy.c
index af5ed81a5765..52991723b25b 100644
--- a/sys/contrib/ipfilter/netinet/ip_proxy.c
+++ b/sys/contrib/ipfilter/netinet/ip_proxy.c
@@ -914,7 +914,7 @@ ipf_proxy_check(fin, nat)
 	ip_t *ip;
 	short rv;
 	int err;
-#if !defined(_KERNEL) || SOLARIS
+#if !defined(_KERNEL) || SOLARIS || defined(__FreeBSD__)
 	u_32_t s1, s2, sd;
 #endif
 
@@ -1006,7 +1006,7 @@ ipf_proxy_check(fin, nat)
 		 * packet.
 		 */
 		adjlen = APR_INC(err);
-#if !defined(_KERNEL) || SOLARIS
+#if !defined(_KERNEL) || SOLARIS || defined(__FreeBSD__)
 		s1 = LONG_SUM(fin->fin_plen - adjlen);
 		s2 = LONG_SUM(fin->fin_plen);
 		CALC_SUMD(s1, s2, sd);