summaryrefslogtreecommitdiffstats
path: root/sys/netinet/sctp_asconf.c
diff options
context:
space:
mode:
authortuexen <tuexen@FreeBSD.org>2013-11-07 17:08:09 +0000
committertuexen <tuexen@FreeBSD.org>2013-11-07 17:08:09 +0000
commitf3b2b3c8135a48b49356f8c6f4e0efe9d9b18edb (patch)
treebccca0b0d26ddc4291a0cab73d60b8f7d08b01e3 /sys/netinet/sctp_asconf.c
parent99e03dfbd8410532c87db9295a638cc8d87f963c (diff)
downloadFreeBSD-src-f3b2b3c8135a48b49356f8c6f4e0efe9d9b18edb.zip
FreeBSD-src-f3b2b3c8135a48b49356f8c6f4e0efe9d9b18edb.tar.gz
Make sure that we don't try to build an ASCONF-ACK chunk
larger than what fits in the the mbuf cluster. This issue was reported by Andrew Galante. MFC after: 3 days
Diffstat (limited to 'sys/netinet/sctp_asconf.c')
-rw-r--r--sys/netinet/sctp_asconf.c3
1 files changed, 2 insertions, 1 deletions
diff --git a/sys/netinet/sctp_asconf.c b/sys/netinet/sctp_asconf.c
index 793c748..a2daf18 100644
--- a/sys/netinet/sctp_asconf.c
+++ b/sys/netinet/sctp_asconf.c
@@ -2616,7 +2616,8 @@ sctp_compose_asconf(struct sctp_tcb *stcb, int *retlen, int addr_locked)
/* get the parameter length */
p_length = SCTP_SIZE32(aa->ap.aph.ph.param_length);
/* will it fit in current chunk? */
- if (SCTP_BUF_LEN(m_asconf) + p_length > stcb->asoc.smallest_mtu) {
+ if ((SCTP_BUF_LEN(m_asconf) + p_length > stcb->asoc.smallest_mtu) ||
+ (SCTP_BUF_LEN(m_asconf) + p_length > MCLBYTES)) {
/* won't fit, so we're done with this chunk */
break;
}
OpenPOWER on IntegriCloud