diff options
author | Kristof Provost <kp@FreeBSD.org> | 2025-01-08 21:23:17 +0000 |
---|---|---|
committer | Kristof Provost <kp@FreeBSD.org> | 2025-01-15 22:02:42 +0000 |
commit | 2d2481c35f5a53322e982e47a2bb8f9085f525b7 (patch) | |
tree | 8ccde0581a1ab48213d7014a5d7becde87f1f316 | |
parent | fab411c4fd5224e3dd44e0eb288d60b27480e2d1 (diff) |
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
-rw-r--r-- | sys/netpfil/pf/pf.c | 17 |
1 files changed, 17 insertions, 0 deletions
diff --git a/sys/netpfil/pf/pf.c b/sys/netpfil/pf/pf.c index 053b0b2ccb31..a49216a9dc20 100644 --- a/sys/netpfil/pf/pf.c +++ b/sys/netpfil/pf/pf.c @@ -140,6 +140,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 *"); @@ -7493,6 +7500,8 @@ pf_multihome_scan(int start, int len, struct pf_pdesc *pd, int op) 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; @@ -7504,6 +7513,9 @@ pf_multihome_scan(int start, int len, struct pf_pdesc *pd, int op) 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; @@ -7533,6 +7545,8 @@ pf_multihome_scan(int start, int len, struct pf_pdesc *pd, int op) if (! job) return (PF_DROP); + SDT_PROBE2(pf, sctp, multihome_scan, ipv4, &t, op); + memcpy(&job->pd, pd, sizeof(*pd)); // New source address! @@ -7566,6 +7580,8 @@ pf_multihome_scan(int start, int len, struct pf_pdesc *pd, int op) 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; @@ -7616,6 +7632,7 @@ pf_multihome_scan(int start, int len, struct pf_pdesc *pd, int op) return (PF_PASS); } + int pf_multihome_scan_init(int start, int len, struct pf_pdesc *pd) { |