git: 2a6465245fa3 - main - ipfilter: Fix IP header checksums post ftp proxy

From: Cy Schubert <cy_at_FreeBSD.org>
Date: Wed, 12 Jan 2022 21:05:21 UTC
The branch main has been updated by cy:

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

commit 2a6465245fa3f5323c2036049a730e2f2b95d270
Author:     Cy Schubert <cy@FreeBSD.org>
AuthorDate: 2022-01-12 20:55:11 +0000
Commit:     Cy Schubert <cy@FreeBSD.org>
CommitDate: 2022-01-12 20:58:05 +0000

    ipfilter: Fix IP header checksums post ftp proxy
    
    Don't assume checksums will be calculated later in fastforward.
    
    MFC after:      1 week
---
 sys/netpfil/ipfilter/netinet/ip_proxy.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/sys/netpfil/ipfilter/netinet/ip_proxy.c b/sys/netpfil/ipfilter/netinet/ip_proxy.c
index 7b185a9202db..3ee88af26886 100644
--- a/sys/netpfil/ipfilter/netinet/ip_proxy.c
+++ b/sys/netpfil/ipfilter/netinet/ip_proxy.c
@@ -884,7 +884,7 @@ ipf_proxy_check(fr_info_t *fin, nat_t *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
 
@@ -976,7 +976,7 @@ ipf_proxy_check(fr_info_t *fin, nat_t *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);