git: 45f475427d8e - stable/14 - pf: inherit v_tag values to multihomed connections

From: Kristof Provost <kp_at_FreeBSD.org>
Date: Mon, 02 Oct 2023 09:33:25 UTC
The branch stable/14 has been updated by kp:

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

commit 45f475427d8e8e1583104350699620fc8aee8735
Author:     Kristof Provost <kp@FreeBSD.org>
AuthorDate: 2023-09-04 16:00:08 +0000
Commit:     Kristof Provost <kp@FreeBSD.org>
CommitDate: 2023-10-02 09:32:14 +0000

    pf: inherit v_tag values to multihomed connections
    
    When we create a new state for an existing SCTP association inherit the
    v_tag values from the original connection.
    
    MFC after:      3 weeks
    Sponsored by:   Orange Business Services
    
    (cherry picked from commit f1cc29af84475b800df5eb94ff7d5b9484ddbdac)
---
 sys/netpfil/pf/pf.c | 6 +++++-
 1 file changed, 5 insertions(+), 1 deletion(-)

diff --git a/sys/netpfil/pf/pf.c b/sys/netpfil/pf/pf.c
index 8958579b7e63..085ab5827e26 100644
--- a/sys/netpfil/pf/pf.c
+++ b/sys/netpfil/pf/pf.c
@@ -5939,8 +5939,12 @@ pf_sctp_multihome_delayed(struct pf_pdesc *pd, int off, struct pfi_kkif *kif,
 		    j->m, off, &j->pd, &ra, &rs, NULL);
 		PF_RULES_RUNLOCK();
 		SDT_PROBE4(pf, sctp, multihome, test, kif, r, j->m, action);
-		if (sm)
+		if (sm) {
+			/* Inherit v_tag values. */
+			sm->src.scrub->pfss_v_tag = s->src.scrub->pfss_flags;
+			sm->dst.scrub->pfss_v_tag = s->dst.scrub->pfss_flags;
 			PF_STATE_UNLOCK(sm);
+		}
 
 		free(j, M_PFTEMP);
 	}