summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--sys/netinet/sctp_constants.h1
-rw-r--r--sys/netinet/sctp_input.c12
-rw-r--r--sys/netinet/sctp_uio.h16
-rw-r--r--sys/netinet/sctp_usrreq.c3
-rw-r--r--sys/netinet/sctputil.c3
5 files changed, 30 insertions, 5 deletions
diff --git a/sys/netinet/sctp_constants.h b/sys/netinet/sctp_constants.h
index 7aee1a1..cf852a4 100644
--- a/sys/netinet/sctp_constants.h
+++ b/sys/netinet/sctp_constants.h
@@ -476,6 +476,7 @@ __FBSDID("$FreeBSD$");
#define SCTP_STATE_CLOSED_SOCKET 0x0100
#define SCTP_STATE_ABOUT_TO_BE_FREED 0x0200
#define SCTP_STATE_PARTIAL_MSG_LEFT 0x0400
+#define SCTP_STATE_WAS_ABORTED 0x0800
#define SCTP_STATE_MASK 0x007f
#define SCTP_GET_STATE(asoc) ((asoc)->state & SCTP_STATE_MASK)
diff --git a/sys/netinet/sctp_input.c b/sys/netinet/sctp_input.c
index b0ca7f5..5a278c1 100644
--- a/sys/netinet/sctp_input.c
+++ b/sys/netinet/sctp_input.c
@@ -4514,6 +4514,18 @@ sctp_common_input_processing(struct mbuf **mm, int iphlen, int offset,
/* always clear this before beginning a packet */
stcb->asoc.authenticated = 0;
stcb->asoc.seen_a_sack_this_pkt = 0;
+ if (stcb->asoc.state & SCTP_STATE_WAS_ABORTED) {
+ /*-
+ * If we hit here, we had a ref count
+ * up when the assoc was aborted and the
+ * timer is clearing out the assoc, we should
+ * NOT respond to any packet.. its OOTB.
+ */
+ SCTP_TCB_UNLOCK(stcb);
+ sctp_handle_ootb(m, iphlen, offset, sh, inp, NULL,
+ vrf_id);
+ goto out_now;
+ }
}
if (IS_SCTP_CONTROL(ch)) {
/* process the control portion of the SCTP packet */
diff --git a/sys/netinet/sctp_uio.h b/sys/netinet/sctp_uio.h
index e0c8441..1689a7c 100644
--- a/sys/netinet/sctp_uio.h
+++ b/sys/netinet/sctp_uio.h
@@ -105,7 +105,15 @@ struct sctp_sndrcvinfo {
};
struct sctp_extrcvinfo {
- struct sctp_sndrcvinfo sreinfo_sinfo;
+ uint16_t sinfo_stream;
+ uint16_t sinfo_ssn;
+ uint16_t sinfo_flags;
+ uint32_t sinfo_ppid;
+ uint32_t sinfo_context;
+ uint32_t sinfo_timetolive;
+ uint32_t sinfo_tsn;
+ uint32_t sinfo_cumtsn;
+ sctp_assoc_t sinfo_assoc_id;
uint16_t sreinfo_next_flags;
uint16_t sreinfo_next_stream;
uint32_t sreinfo_next_aid;
@@ -504,9 +512,9 @@ struct sctp_hmacalgo {
#define SCTP_AUTH_HMAC_ID_SHA1 0x0001 /* default, mandatory */
#define SCTP_AUTH_HMAC_ID_MD5 0x0002 /* deprecated */
#define SCTP_AUTH_HMAC_ID_SHA256 0x0003
-#define SCTP_AUTH_HMAC_ID_SHA224 0x8001
-#define SCTP_AUTH_HMAC_ID_SHA384 0x8002
-#define SCTP_AUTH_HMAC_ID_SHA512 0x8003
+#define SCTP_AUTH_HMAC_ID_SHA224 0x0004
+#define SCTP_AUTH_HMAC_ID_SHA384 0x0005
+#define SCTP_AUTH_HMAC_ID_SHA512 0x0006
/* SCTP_AUTH_ACTIVE_KEY / SCTP_AUTH_DELETE_KEY */
diff --git a/sys/netinet/sctp_usrreq.c b/sys/netinet/sctp_usrreq.c
index 240e96c..54b31b53 100644
--- a/sys/netinet/sctp_usrreq.c
+++ b/sys/netinet/sctp_usrreq.c
@@ -734,7 +734,8 @@ sctp_disconnect(struct socket *so)
return (ENOTCONN);
}
SCTP_INP_RLOCK(inp);
- if (inp->sctp_flags & SCTP_PCB_FLAGS_TCPTYPE) {
+ if ((inp->sctp_flags & SCTP_PCB_FLAGS_TCPTYPE) ||
+ (inp->sctp_flags & SCTP_PCB_FLAGS_IN_TCPPOOL)) {
if (SCTP_LIST_EMPTY(&inp->sctp_asoc_list)) {
/* No connection */
SCTP_INP_RUNLOCK(inp);
diff --git a/sys/netinet/sctputil.c b/sys/netinet/sctputil.c
index bf0eb29..573c3d3 100644
--- a/sys/netinet/sctputil.c
+++ b/sys/netinet/sctputil.c
@@ -3653,6 +3653,7 @@ sctp_abort_association(struct sctp_inpcb *inp, struct sctp_tcb *stcb,
sctp_abort_notification(stcb, 0);
/* get the assoc vrf id and table id */
vrf_id = stcb->asoc.vrf_id;
+ stcb->asoc.state |= SCTP_STATE_WAS_ABORTED;
}
sctp_send_abort(m, iphlen, sh, vtag, op_err, vrf_id);
if (stcb != NULL) {
@@ -3747,6 +3748,8 @@ sctp_abort_an_association(struct sctp_inpcb *inp, struct sctp_tcb *stcb,
}
}
return;
+ } else {
+ stcb->asoc.state |= SCTP_STATE_WAS_ABORTED;
}
vtag = stcb->asoc.peer_vtag;
/* notify the ulp */
OpenPOWER on IntegriCloud