|
@@ -224,7 +224,9 @@ struct sctp_chunk *sctp_make_init(const struct sctp_association *asoc,
|
|
num_ext += 2;
|
|
num_ext += 2;
|
|
}
|
|
}
|
|
|
|
|
|
- chunksize += sizeof(aiparam);
|
|
|
|
|
|
+ if (sp->adaptation_ind)
|
|
|
|
+ chunksize += sizeof(aiparam);
|
|
|
|
+
|
|
chunksize += vparam_len;
|
|
chunksize += vparam_len;
|
|
|
|
|
|
/* Account for AUTH related parameters */
|
|
/* Account for AUTH related parameters */
|
|
@@ -304,10 +306,12 @@ struct sctp_chunk *sctp_make_init(const struct sctp_association *asoc,
|
|
if (sctp_prsctp_enable)
|
|
if (sctp_prsctp_enable)
|
|
sctp_addto_chunk(retval, sizeof(prsctp_param), &prsctp_param);
|
|
sctp_addto_chunk(retval, sizeof(prsctp_param), &prsctp_param);
|
|
|
|
|
|
- aiparam.param_hdr.type = SCTP_PARAM_ADAPTATION_LAYER_IND;
|
|
|
|
- aiparam.param_hdr.length = htons(sizeof(aiparam));
|
|
|
|
- aiparam.adaptation_ind = htonl(sp->adaptation_ind);
|
|
|
|
- sctp_addto_chunk(retval, sizeof(aiparam), &aiparam);
|
|
|
|
|
|
+ if (sp->adaptation_ind) {
|
|
|
|
+ aiparam.param_hdr.type = SCTP_PARAM_ADAPTATION_LAYER_IND;
|
|
|
|
+ aiparam.param_hdr.length = htons(sizeof(aiparam));
|
|
|
|
+ aiparam.adaptation_ind = htonl(sp->adaptation_ind);
|
|
|
|
+ sctp_addto_chunk(retval, sizeof(aiparam), &aiparam);
|
|
|
|
+ }
|
|
|
|
|
|
/* Add SCTP-AUTH chunks to the parameter list */
|
|
/* Add SCTP-AUTH chunks to the parameter list */
|
|
if (sctp_auth_enable) {
|
|
if (sctp_auth_enable) {
|
|
@@ -332,6 +336,7 @@ struct sctp_chunk *sctp_make_init_ack(const struct sctp_association *asoc,
|
|
sctp_inithdr_t initack;
|
|
sctp_inithdr_t initack;
|
|
struct sctp_chunk *retval;
|
|
struct sctp_chunk *retval;
|
|
union sctp_params addrs;
|
|
union sctp_params addrs;
|
|
|
|
+ struct sctp_sock *sp;
|
|
int addrs_len;
|
|
int addrs_len;
|
|
sctp_cookie_param_t *cookie;
|
|
sctp_cookie_param_t *cookie;
|
|
int cookie_len;
|
|
int cookie_len;
|
|
@@ -366,6 +371,7 @@ struct sctp_chunk *sctp_make_init_ack(const struct sctp_association *asoc,
|
|
/* Calculate the total size of allocation, include the reserved
|
|
/* Calculate the total size of allocation, include the reserved
|
|
* space for reporting unknown parameters if it is specified.
|
|
* space for reporting unknown parameters if it is specified.
|
|
*/
|
|
*/
|
|
|
|
+ sp = sctp_sk(asoc->base.sk);
|
|
chunksize = sizeof(initack) + addrs_len + cookie_len + unkparam_len;
|
|
chunksize = sizeof(initack) + addrs_len + cookie_len + unkparam_len;
|
|
|
|
|
|
/* Tell peer that we'll do ECN only if peer advertised such cap. */
|
|
/* Tell peer that we'll do ECN only if peer advertised such cap. */
|
|
@@ -381,7 +387,8 @@ struct sctp_chunk *sctp_make_init_ack(const struct sctp_association *asoc,
|
|
num_ext += 2;
|
|
num_ext += 2;
|
|
}
|
|
}
|
|
|
|
|
|
- chunksize += sizeof(aiparam);
|
|
|
|
|
|
+ if (sp->adaptation_ind)
|
|
|
|
+ chunksize += sizeof(aiparam);
|
|
|
|
|
|
if (asoc->peer.auth_capable) {
|
|
if (asoc->peer.auth_capable) {
|
|
auth_random = (sctp_paramhdr_t *)asoc->c.auth_random;
|
|
auth_random = (sctp_paramhdr_t *)asoc->c.auth_random;
|
|
@@ -432,10 +439,12 @@ struct sctp_chunk *sctp_make_init_ack(const struct sctp_association *asoc,
|
|
if (asoc->peer.prsctp_capable)
|
|
if (asoc->peer.prsctp_capable)
|
|
sctp_addto_chunk(retval, sizeof(prsctp_param), &prsctp_param);
|
|
sctp_addto_chunk(retval, sizeof(prsctp_param), &prsctp_param);
|
|
|
|
|
|
- aiparam.param_hdr.type = SCTP_PARAM_ADAPTATION_LAYER_IND;
|
|
|
|
- aiparam.param_hdr.length = htons(sizeof(aiparam));
|
|
|
|
- aiparam.adaptation_ind = htonl(sctp_sk(asoc->base.sk)->adaptation_ind);
|
|
|
|
- sctp_addto_chunk(retval, sizeof(aiparam), &aiparam);
|
|
|
|
|
|
+ if (sp->adaptation_ind) {
|
|
|
|
+ aiparam.param_hdr.type = SCTP_PARAM_ADAPTATION_LAYER_IND;
|
|
|
|
+ aiparam.param_hdr.length = htons(sizeof(aiparam));
|
|
|
|
+ aiparam.adaptation_ind = htonl(sp->adaptation_ind);
|
|
|
|
+ sctp_addto_chunk(retval, sizeof(aiparam), &aiparam);
|
|
|
|
+ }
|
|
|
|
|
|
if (asoc->peer.auth_capable) {
|
|
if (asoc->peer.auth_capable) {
|
|
sctp_addto_chunk(retval, ntohs(auth_random->length),
|
|
sctp_addto_chunk(retval, ntohs(auth_random->length),
|