git: 54912d47b629 - main - sctp: unbreak NOINET6 builds.

From: Michael Tuexen <tuexen_at_FreeBSD.org>
Date: Sat, 04 Dec 2021 18:16:25 UTC
The branch main has been updated by tuexen:

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

commit 54912d47b629807cefaed5b65a8f4e6d9bbbdbcf
Author:     Michael Tuexen <tuexen@FreeBSD.org>
AuthorDate: 2021-12-04 18:13:28 +0000
Commit:     Michael Tuexen <tuexen@FreeBSD.org>
CommitDate: 2021-12-04 18:16:18 +0000

    sctp: unbreak NOINET6 builds.
    
    PR:             260119
    Reported by:    kostikbel
    MFC after:      1 week
---
 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 63a99cbc2c07..b4a742c11629 100644
--- a/sys/netinet/sctp_pcb.c
+++ b/sys/netinet/sctp_pcb.c
@@ -2622,15 +2622,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,