Skip site navigation (1)Skip section navigation (2)
Date:      Mon, 21 Apr 2025 12:49:08 GMT
From:      Kristof Provost <kp@FreeBSD.org>
To:        src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org
Subject:   git: 88986a4d7183 - main - pf: fix ICMP pcksum pointers
Message-ID:  <202504211249.53LCn8rO077535@gitrepo.freebsd.org>

next in thread | raw e-mail | index | archive | help
The branch main has been updated by kp:

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

commit 88986a4d71836e120deb838be86e51084f863772
Author:     Kristof Provost <kp@FreeBSD.org>
AuthorDate: 2025-04-16 14:55:26 +0000
Commit:     Kristof Provost <kp@FreeBSD.org>
CommitDate: 2025-04-21 08:43:31 +0000

    pf: fix ICMP pcksum pointers
    
    We didn't set it for ICMP, and used the ICMP header for ICMPv6. Fortunately the
    checksum is in the same place in the header for icmp4 and icmp6, but use the
    correct name anyway.
    
    Sponsored by:   Rubicon Communications, LLC ("Netgate")
---
 sys/netpfil/pf/pf.c | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/sys/netpfil/pf/pf.c b/sys/netpfil/pf/pf.c
index 88e9ef78f07c..463504bebcbc 100644
--- a/sys/netpfil/pf/pf.c
+++ b/sys/netpfil/pf/pf.c
@@ -10064,6 +10064,7 @@ pf_setup_pdesc(sa_family_t af, int dir, struct pf_pdesc *pd, struct mbuf **m0,
 			REASON_SET(reason, PFRES_SHORT);
 			return (-1);
 		}
+		pd->pcksum = &pd->hdr.icmp.icmp_cksum;
 		pd->hdrlen = ICMP_MINLEN;
 		break;
 	}
@@ -10096,7 +10097,7 @@ pf_setup_pdesc(sa_family_t af, int dir, struct pf_pdesc *pd, struct mbuf **m0,
 			return (-1);
 		}
 		pd->hdrlen = icmp_hlen;
-		pd->pcksum = &pd->hdr.icmp.icmp_cksum;
+		pd->pcksum = &pd->hdr.icmp6.icmp6_cksum;
 		break;
 	}
 #endif /* INET6 */



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?202504211249.53LCn8rO077535>