diff options
author | tuexen <tuexen@FreeBSD.org> | 2013-11-07 17:08:09 +0000 |
---|---|---|
committer | tuexen <tuexen@FreeBSD.org> | 2013-11-07 17:08:09 +0000 |
commit | f3b2b3c8135a48b49356f8c6f4e0efe9d9b18edb (patch) | |
tree | bccca0b0d26ddc4291a0cab73d60b8f7d08b01e3 /sys/netinet/sctp_asconf.c | |
parent | 99e03dfbd8410532c87db9295a638cc8d87f963c (diff) | |
download | FreeBSD-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.c | 3 |
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; } |