Update to 2.6.32.39 Mainline
/net/sctp/sm_make_chunk.c
blob:feedee7afa2c5906f633da501eae34a2e61d9f89 -> blob:8579b4f2f24f5bd5077bdaa9b142b1e292daeb53
--- net/sctp/sm_make_chunk.c
+++ net/sctp/sm_make_chunk.c
@@ -230,8 +230,7 @@ struct sctp_chunk *sctp_make_init(const
sp = sctp_sk(asoc->base.sk);
num_types = sp->pf->supported_addrs(sp, types);
- chunksize = sizeof(init) + addrs_len;
- chunksize += WORD_ROUND(SCTP_SAT_LEN(num_types));
+ chunksize = sizeof(init) + addrs_len + SCTP_SAT_LEN(num_types);
chunksize += sizeof(ecap_param);
if (sctp_prsctp_enable)
@@ -261,14 +260,14 @@ struct sctp_chunk *sctp_make_init(const
/* Add HMACS parameter length if any were defined */
auth_hmacs = (sctp_paramhdr_t *)asoc->c.auth_hmacs;
if (auth_hmacs->length)
- chunksize += WORD_ROUND(ntohs(auth_hmacs->length));
+ chunksize += ntohs(auth_hmacs->length);
else
auth_hmacs = NULL;
/* Add CHUNKS parameter length */
auth_chunks = (sctp_paramhdr_t *)asoc->c.auth_chunks;
if (auth_chunks->length)
- chunksize += WORD_ROUND(ntohs(auth_chunks->length));
+ chunksize += ntohs(auth_chunks->length);
else
auth_chunks = NULL;
@@ -278,8 +277,7 @@ struct sctp_chunk *sctp_make_init(const
/* If we have any extensions to report, account for that */
if (num_ext)
- chunksize += WORD_ROUND(sizeof(sctp_supported_ext_param_t) +
- num_ext);
+ chunksize += sizeof(sctp_supported_ext_param_t) + num_ext;
/* RFC 2960 3.3.2 Initiation (INIT) (1)
*
@@ -421,13 +419,13 @@ struct sctp_chunk *sctp_make_init_ack(co
auth_hmacs = (sctp_paramhdr_t *)asoc->c.auth_hmacs;
if (auth_hmacs->length)
- chunksize += WORD_ROUND(ntohs(auth_hmacs->length));
+ chunksize += ntohs(auth_hmacs->length);
else
auth_hmacs = NULL;
auth_chunks = (sctp_paramhdr_t *)asoc->c.auth_chunks;
if (auth_chunks->length)
- chunksize += WORD_ROUND(ntohs(auth_chunks->length));
+ chunksize += ntohs(auth_chunks->length);
else
auth_chunks = NULL;
@@ -436,8 +434,7 @@ struct sctp_chunk *sctp_make_init_ack(co
}
if (num_ext)
- chunksize += WORD_ROUND(sizeof(sctp_supported_ext_param_t) +
- num_ext);
+ chunksize += sizeof(sctp_supported_ext_param_t) + num_ext;
/* Now allocate and fill out the chunk. */
retval = sctp_make_chunk(asoc, SCTP_CID_INIT_ACK, 0, chunksize);
@@ -3364,6 +3361,21 @@ int sctp_process_asconf_ack(struct sctp_
sctp_chunk_free(asconf);
asoc->addip_last_asconf = NULL;
+ /* Send the next asconf chunk from the addip chunk queue. */
+ if (!list_empty(&asoc->addip_chunk_list)) {
+ struct list_head *entry = asoc->addip_chunk_list.next;
+ asconf = list_entry(entry, struct sctp_chunk, list);
+
+ list_del_init(entry);
+
+ /* Hold the chunk until an ASCONF_ACK is received. */
+ sctp_chunk_hold(asconf);
+ if (sctp_primitive_ASCONF(asoc, asconf))
+ sctp_chunk_free(asconf);
+ else
+ asoc->addip_last_asconf = asconf;
+ }
+
return retval;
}