Author: tuexen
Date: Thu Nov  7 17:08:09 2013
New Revision: 257803
URL: http://svnweb.freebsd.org/changeset/base/257803

Log:
  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

Modified:
  head/sys/netinet/sctp_asconf.c

Modified: head/sys/netinet/sctp_asconf.c
==============================================================================
--- head/sys/netinet/sctp_asconf.c      Thu Nov  7 16:58:09 2013        
(r257802)
+++ head/sys/netinet/sctp_asconf.c      Thu Nov  7 17:08:09 2013        
(r257803)
@@ -2616,7 +2616,8 @@ sctp_compose_asconf(struct sctp_tcb *stc
                /* 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;
                }
_______________________________________________
svn-src-head@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/svn-src-head
To unsubscribe, send any mail to "svn-src-head-unsubscr...@freebsd.org"

Reply via email to