diff options
author | rrs <rrs@FreeBSD.org> | 2008-01-28 10:31:12 +0000 |
---|---|---|
committer | rrs <rrs@FreeBSD.org> | 2008-01-28 10:31:12 +0000 |
commit | 9df3360d89c8e90e02b46d3cea5ee7605e0d40c5 (patch) | |
tree | 6610696648053b80ebddb9773e7a8cd0aa84d354 /sys/netinet/sctp_auth.c | |
parent | 13897491cf6e6e0e91057676fd87677fb658a01a (diff) | |
download | FreeBSD-src-9df3360d89c8e90e02b46d3cea5ee7605e0d40c5.zip FreeBSD-src-9df3360d89c8e90e02b46d3cea5ee7605e0d40c5.tar.gz |
- Fix a bug where the socket may have been closed which
could cause a crash in the auth code.
Obtained from: Michael Tuexen
MFC after: 1 week
Diffstat (limited to 'sys/netinet/sctp_auth.c')
-rw-r--r-- | sys/netinet/sctp_auth.c | 8 |
1 files changed, 8 insertions, 0 deletions
diff --git a/sys/netinet/sctp_auth.c b/sys/netinet/sctp_auth.c index 5f45540..a7d0d84 100644 --- a/sys/netinet/sctp_auth.c +++ b/sys/netinet/sctp_auth.c @@ -1807,6 +1807,14 @@ sctp_notify_authentication(struct sctp_tcb *stcb, uint32_t indication, struct sctp_authkey_event *auth; struct sctp_queued_to_read *control; + if ((stcb == NULL) || + (stcb->sctp_ep->sctp_flags & SCTP_PCB_FLAGS_SOCKET_GONE) || + (stcb->sctp_ep->sctp_flags & SCTP_PCB_FLAGS_SOCKET_ALLGONE) || + (stcb->asoc.state & SCTP_STATE_CLOSED_SOCKET) + ) { + /* If the socket is gone we are out of here */ + return; + } if (sctp_is_feature_off(stcb->sctp_ep, SCTP_PCB_FLAGS_AUTHEVNT)) /* event not enabled */ return; |