Merge branch 'sched-fixes-for-linus' of git://git.kernel.org/pub/scm/linux/kernel...
[pandora-kernel.git] / net / sctp / endpointola.c
index e39a0cd..4c8d9f4 100644 (file)
@@ -103,6 +103,7 @@ static struct sctp_endpoint *sctp_endpoint_init(struct sctp_endpoint *ep,
 
                /* Initialize the CHUNKS parameter */
                auth_chunks->param_hdr.type = SCTP_PARAM_CHUNKS;
+               auth_chunks->param_hdr.length = htons(sizeof(sctp_paramhdr_t));
 
                /* If the Add-IP functionality is enabled, we must
                 * authenticate, ASCONF and ASCONF-ACK chunks
@@ -110,8 +111,7 @@ static struct sctp_endpoint *sctp_endpoint_init(struct sctp_endpoint *ep,
                if (sctp_addip_enable) {
                        auth_chunks->chunks[0] = SCTP_CID_ASCONF;
                        auth_chunks->chunks[1] = SCTP_CID_ASCONF_ACK;
-                       auth_chunks->param_hdr.length =
-                                       htons(sizeof(sctp_paramhdr_t) + 2);
+                       auth_chunks->param_hdr.length += htons(2);
                }
        }