diff options
| author | Michael Tuexen <tuexen@FreeBSD.org> | 2026-02-27 07:51:29 +0000 |
|---|---|---|
| committer | Michael Tuexen <tuexen@FreeBSD.org> | 2026-02-27 07:56:01 +0000 |
| commit | 6bd97e9e01ff159eef49b2521fdbe67d5db10d95 (patch) | |
| tree | ba1bd2d281d4cf71905c88cc2e863631116fd5ce | |
| parent | db16856110cbdbdfdc3c8d44edae1b3a7463198e (diff) | |
sctp: fix NOINET build
Reported by: ngie
Fixes: 454212b9718b ("sctp: fix so_proto when peeling off a socket")
MFC after: 3 days
| -rw-r--r-- | sys/netinet/sctp_syscalls.c | 21 |
1 files changed, 20 insertions, 1 deletions
diff --git a/sys/netinet/sctp_syscalls.c b/sys/netinet/sctp_syscalls.c index 01f241d29637..4837925fdfd7 100644 --- a/sys/netinet/sctp_syscalls.c +++ b/sys/netinet/sctp_syscalls.c @@ -29,6 +29,8 @@ */ #include "opt_capsicum.h" +#include "opt_inet.h" +#include "opt_inet6.h" #include "opt_sctp.h" #include "opt_ktrace.h" @@ -77,6 +79,9 @@ #include <netinet/sctp.h> #include <netinet/sctp_pcb.h> #include <netinet/sctp_var.h> +#ifdef INET6 +#include <netinet6/sctp6_var.h> +#endif #include <netinet/sctp_os_bsd.h> #include <netinet/sctp_peeloff.h> @@ -173,7 +178,21 @@ sys_sctp_peeloff(struct thread *td, struct sctp_peeloff_args *uap) td->td_retval[0] = fd; CURVNET_SET(head->so_vnet); - so = sopeeloff(head, &sctp_stream_protosw); + switch (head->so_proto->pr_domain->dom_family) { +#ifdef INET + case AF_INET: + so = sopeeloff(head, &sctp_stream_protosw); + break; +#endif +#ifdef INET6 + case AF_INET6: + so = sopeeloff(head, &sctp6_stream_protosw); + break; +#endif + default: + error = EOPNOTSUPP; + goto noconnection; + } if (so == NULL) { error = ENOMEM; goto noconnection; |
