mirror of
https://github.com/freebsd/freebsd-src.git
synced 2026-11-07 12:48:33 -10:00
sctp: fix so_proto when peeling off a socket
Reported by: glebius
Reviewed by: rrs
Fixes: d195b3783f ("sctp: fix socket type created by sctp_peeloff()")
Differential Revision: https://reviews.freebsd.org/D55454
This commit is contained in:
1 parent
bce0c14fe1
commit
454212b971
3 files changed
+6
-4
No files matched your search
@@ -1316,7 +1316,7 @@ solisten_enqueue(struct socket *so, int connstatus)
|
||||
* XXXGL: reduce copy-paste with solisten_clone().
|
||||
*/
|
||||
struct socket *
|
||||
sopeeloff(struct socket *head)
|
||||
sopeeloff(struct socket *head, struct protosw *so_proto)
|
||||
{
|
||||
struct socket *so;
|
||||
|
||||
@@ -1336,7 +1336,7 @@ sopeeloff(struct socket *head)
|
||||
so->so_linger = head->so_linger;
|
||||
so->so_state = (head->so_state & SS_NBIO) | SS_ISCONNECTED;
|
||||
so->so_fibnum = head->so_fibnum;
|
||||
so->so_proto = head->so_proto;
|
||||
so->so_proto = so_proto;
|
||||
so->so_cred = crhold(head->so_cred);
|
||||
#ifdef MAC
|
||||
mac_socket_newconn(head, so);
|
||||
|
||||
@@ -75,6 +75,8 @@
|
||||
#include <security/mac/mac_framework.h>
|
||||
|
||||
#include <netinet/sctp.h>
|
||||
#include <netinet/sctp_pcb.h>
|
||||
#include <netinet/sctp_var.h>
|
||||
#include <netinet/sctp_os_bsd.h>
|
||||
#include <netinet/sctp_peeloff.h>
|
||||
|
||||
@@ -171,7 +173,7 @@ sys_sctp_peeloff(struct thread *td, struct sctp_peeloff_args *uap)
|
||||
td->td_retval[0] = fd;
|
||||
|
||||
CURVNET_SET(head->so_vnet);
|
||||
so = sopeeloff(head);
|
||||
so = sopeeloff(head, &sctp_stream_protosw);
|
||||
if (so == NULL) {
|
||||
error = ENOMEM;
|
||||
goto noconnection;
|
||||
|
||||
+1
-1
@@ -525,7 +525,7 @@ struct socket *
|
||||
struct socket *
|
||||
sonewconn(struct socket *head, int connstatus);
|
||||
struct socket *
|
||||
sopeeloff(struct socket *);
|
||||
sopeeloff(struct socket *, struct protosw *);
|
||||
int sopoll_generic(struct socket *so, int events, struct thread *td);
|
||||
int sokqfilter_generic(struct socket *so, struct knote *kn);
|
||||
int soaio_queue_generic(struct socket *so, struct kaiocb *job);
|
||||
|
||||
Reference in new issue
Block a user