summaryrefslogtreecommitdiffstats
path: root/sys/netinet/sctp_indata.c
diff options
context:
space:
mode:
authortuexen <tuexen@FreeBSD.org>2014-06-22 16:38:06 +0000
committertuexen <tuexen@FreeBSD.org>2014-06-22 16:38:06 +0000
commitd5831ca68c9363368857a52fbea709db33ea77b1 (patch)
treec0582d8dd2530d0a0a2bbf332e7f0630fbdf7926 /sys/netinet/sctp_indata.c
parent493873a6efe2361a2d7d86dfb3bb29b3e72c5302 (diff)
downloadFreeBSD-src-d5831ca68c9363368857a52fbea709db33ea77b1.zip
FreeBSD-src-d5831ca68c9363368857a52fbea709db33ea77b1.tar.gz
MFC r264679:
Send the correct error cause, when a DATA chunk with no user data is received. This bug was reported by Irene Ruengeler.
Diffstat (limited to 'sys/netinet/sctp_indata.c')
-rw-r--r--sys/netinet/sctp_indata.c17
1 files changed, 16 insertions, 1 deletions
diff --git a/sys/netinet/sctp_indata.c b/sys/netinet/sctp_indata.c
index 2c2c4bd..4f0f384 100644
--- a/sys/netinet/sctp_indata.c
+++ b/sys/netinet/sctp_indata.c
@@ -2323,7 +2323,7 @@ sctp_process_data(struct mbuf **mm, int iphlen, int *offset, int length,
continue;
}
if (ch->ch.chunk_type == SCTP_DATA) {
- if ((size_t)chk_length < sizeof(struct sctp_data_chunk) + 1) {
+ if ((size_t)chk_length < sizeof(struct sctp_data_chunk)) {
/*
* Need to send an abort since we had a
* invalid data chunk.
@@ -2341,6 +2341,21 @@ sctp_process_data(struct mbuf **mm, int iphlen, int *offset, int length,
vrf_id, port);
return (2);
}
+ if ((size_t)chk_length == sizeof(struct sctp_data_chunk)) {
+ /*
+ * Need to send an abort since we had an
+ * empty data chunk.
+ */
+ struct mbuf *op_err;
+
+ op_err = sctp_generate_no_user_data_cause(ch->dp.tsn);
+ stcb->sctp_ep->last_abort_code = SCTP_FROM_SCTP_INDATA + SCTP_LOC_19;
+ sctp_abort_association(inp, stcb, m, iphlen,
+ src, dst, sh, op_err,
+ use_mflowid, mflowid,
+ vrf_id, port);
+ return (2);
+ }
#ifdef SCTP_AUDITING_ENABLED
sctp_audit_log(0xB1, 0);
#endif
OpenPOWER on IntegriCloud