Skip site navigation (1)Skip section navigation (2)
Date:      Thu, 30 Jan 2025 11:01:59 GMT
From:      Kristof Provost <kp@FreeBSD.org>
To:        src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org
Subject:   git: d467e667dfcc - stable/14 - pf: add extra SCTP multihoming probe points
Message-ID:  <202501301101.50UB1xeQ077869@gitrepo.freebsd.org>

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

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

commit d467e667dfcc26712f10491b6734c79689c41d5b
Author:     Kristof Provost <kp@FreeBSD.org>
AuthorDate: 2025-01-08 21:23:17 +0000
Commit:     Kristof Provost <kp@FreeBSD.org>
CommitDate: 2025-01-30 11:00:30 +0000

    pf: add extra SCTP multihoming probe points
    
    Add probe points in the SCTP multihome parsing code. This is intended to help
    debug a multihome issue, and is expected to be generally useful, so will be
    included for everyone.
    
    MFC after:      2 weeks
    Sponsored by:   Orange Business Services
    
    (cherry picked from commit 2d2481c35f5a53322e982e47a2bb8f9085f525b7)
---
 sys/netpfil/pf/pf.c | 17 +++++++++++++++++
 1 file changed, 17 insertions(+)

diff --git a/sys/netpfil/pf/pf.c b/sys/netpfil/pf/pf.c
index 31c3dd8009de..255d85440fa5 100644
--- a/sys/netpfil/pf/pf.c
+++ b/sys/netpfil/pf/pf.c
@@ -132,6 +132,13 @@ SDT_PROBE_DEFINE2(pf, sctp, multihome, add, "uint32_t",
     "struct pf_sctp_source *");
 SDT_PROBE_DEFINE3(pf, sctp, multihome, remove, "uint32_t",
     "struct pf_kstate *", "struct pf_sctp_source *");
+SDT_PROBE_DEFINE4(pf, sctp, multihome_scan, entry, "int",
+    "int", "struct pf_pdesc *", "int");
+SDT_PROBE_DEFINE2(pf, sctp, multihome_scan, param, "uint16_t", "uint16_t");
+SDT_PROBE_DEFINE2(pf, sctp, multihome_scan, ipv4, "struct in_addr *",
+    "int");
+SDT_PROBE_DEFINE2(pf, sctp, multihome_scan, ipv6, "struct in_addr6 *",
+    "int");
 
 SDT_PROBE_DEFINE3(pf, eth, test_rule, entry, "int", "struct ifnet *",
     "struct mbuf *");
@@ -6533,6 +6540,8 @@ pf_multihome_scan(struct mbuf *m, int start, int len, struct pf_pdesc *pd,
 	int			 off = 0;
 	struct pf_sctp_multihome_job	*job;
 
+	SDT_PROBE4(pf, sctp, multihome_scan, entry, start, len, pd, op);
+
 	while (off < len) {
 		struct sctp_paramhdr h;
 
@@ -6544,6 +6553,9 @@ pf_multihome_scan(struct mbuf *m, int start, int len, struct pf_pdesc *pd,
 		if (ntohs(h.param_length) < 4)
 			return (PF_DROP);
 
+		SDT_PROBE2(pf, sctp, multihome_scan, param, ntohs(h.param_type),
+		    ntohs(h.param_length));
+
 		switch (ntohs(h.param_type)) {
 		case  SCTP_IPV4_ADDRESS: {
 			struct in_addr t;
@@ -6573,6 +6585,8 @@ pf_multihome_scan(struct mbuf *m, int start, int len, struct pf_pdesc *pd,
 			if (! job)
 				return (PF_DROP);
 
+			SDT_PROBE2(pf, sctp, multihome_scan, ipv4, &t, op);
+
 			memcpy(&job->pd, pd, sizeof(*pd));
 
 			// New source address!
@@ -6606,6 +6620,8 @@ pf_multihome_scan(struct mbuf *m, int start, int len, struct pf_pdesc *pd,
 			if (! job)
 				return (PF_DROP);
 
+			SDT_PROBE2(pf, sctp, multihome_scan, ipv6, &t, op);
+
 			memcpy(&job->pd, pd, sizeof(*pd));
 			memcpy(&job->src, &t, sizeof(t));
 			job->pd.src = &job->src;
@@ -6656,6 +6672,7 @@ pf_multihome_scan(struct mbuf *m, int start, int len, struct pf_pdesc *pd,
 
 	return (PF_PASS);
 }
+
 int
 pf_multihome_scan_init(struct mbuf *m, int start, int len, struct pf_pdesc *pd,
     struct pfi_kkif *kif)



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