git: c5f3adcce386 - stable/13 - sctp: unbreak NOINET6 builds.

From: Michael Tuexen <tuexen_at_FreeBSD.org>
Date: Fri, 10 Dec 2021 10:41:54 UTC
The branch stable/13 has been updated by tuexen:

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

commit c5f3adcce3862cb800d64ae8fd332183ba6eb268
Author:     Michael Tuexen <tuexen@FreeBSD.org>
AuthorDate: 2021-12-04 18:13:28 +0000
Commit:     Michael Tuexen <tuexen@FreeBSD.org>
CommitDate: 2021-12-10 10:41:44 +0000

    sctp: unbreak NOINET6 builds.
    
    PR:             260119
    Reported by:    kostikbel
    MFC after:      1 week
    
    (cherry picked from commit 54912d47b629807cefaed5b65a8f4e6d9bbbdbcf)
---
 sys/netinet/sctp_pcb.c | 10 +++++++++-
 1 file changed, 9 insertions(+), 1 deletion(-)

diff --git a/sys/netinet/sctp_pcb.c b/sys/netinet/sctp_pcb.c
index 86f315afe051..afca21d36125 100644
--- a/sys/netinet/sctp_pcb.c
+++ b/sys/netinet/sctp_pcb.c
@@ -2627,15 +2627,23 @@ sctp_move_pcb_and_assoc(struct sctp_inpcb *old_inp, struct sctp_inpcb *new_inp,
 	SCTP_TCB_LOCK(stcb);
 	atomic_subtract_int(&stcb->asoc.refcnt, 1);
 
+#ifdef INET6
 	if (old_inp->sctp_flags & SCTP_PCB_FLAGS_BOUND_V6) {
 		new_inp->ip_inp.inp.inp_flags |= old_inp->ip_inp.inp.inp_flags & INP_CONTROLOPTS;
 		if (old_inp->ip_inp.inp.in6p_outputopts) {
 			new_inp->ip_inp.inp.in6p_outputopts = ip6_copypktopts(old_inp->ip_inp.inp.in6p_outputopts, M_NOWAIT);
 		}
-	} else {
+	}
+#endif
+#if defined(INET) && defined(INET6)
+	else
+#endif
+#ifdef INET
+	{
 		new_inp->ip_inp.inp.inp_ip_tos = old_inp->ip_inp.inp.inp_ip_tos;
 		new_inp->ip_inp.inp.inp_ip_ttl = old_inp->ip_inp.inp.inp_ip_ttl;
 	}
+#endif
 	new_inp->sctp_ep.time_of_secret_change =
 	    old_inp->sctp_ep.time_of_secret_change;
 	memcpy(new_inp->sctp_ep.secret_key, old_inp->sctp_ep.secret_key,