Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 74503
b: refs/heads/master
c: 8ee4be3
h: refs/heads/master
i:
  74501: c69909f
  74499: ec277c6
  74495: a29ae25
v: v3
  • Loading branch information
Vlad Yasevich committed Nov 29, 2007
1 parent 113b600 commit 6d01723
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 16 deletions.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: 9baffaa689a50ef9480ecd9017ffd1480c807328
refs/heads/master: 8ee4be37e8ac28e79ae673d441e83c1f51e7ecfd
23 changes: 8 additions & 15 deletions trunk/net/sctp/sm_make_chunk.c
Original file line number Diff line number Diff line change
Expand Up @@ -77,6 +77,8 @@ static int sctp_process_param(struct sctp_association *asoc,
union sctp_params param,
const union sctp_addr *peer_addr,
gfp_t gfp);
static void *sctp_addto_param(struct sctp_chunk *chunk, int len,
const void *data);

/* What was the inbound interface for this chunk? */
int sctp_chunk_iif(const struct sctp_chunk *chunk)
Expand Down Expand Up @@ -207,11 +209,7 @@ struct sctp_chunk *sctp_make_init(const struct sctp_association *asoc,

chunksize = sizeof(init) + addrs_len + SCTP_SAT_LEN(num_types);
chunksize += sizeof(ecap_param);
if (sctp_prsctp_enable) {
chunksize += sizeof(prsctp_param);
extensions[num_ext] = SCTP_CID_FWD_TSN;
num_ext += 1;
}

/* ADDIP: Section 4.2.7:
* An implementation supporting this extension [ADDIP] MUST list
* the ASCONF,the ASCONF-ACK, and the AUTH chunks in its INIT and
Expand Down Expand Up @@ -297,7 +295,7 @@ struct sctp_chunk *sctp_make_init(const struct sctp_association *asoc,
htons(sizeof(sctp_supported_ext_param_t) + num_ext);
sctp_addto_chunk(retval, sizeof(sctp_supported_ext_param_t),
&ext_param);
sctp_addto_chunk(retval, num_ext, extensions);
sctp_addto_param(retval, num_ext, extensions);
}

if (sctp_prsctp_enable)
Expand Down Expand Up @@ -371,20 +369,12 @@ struct sctp_chunk *sctp_make_init_ack(const struct sctp_association *asoc,
if (asoc->peer.ecn_capable)
chunksize += sizeof(ecap_param);

/* Tell peer that we'll do PR-SCTP only if peer advertised. */
if (asoc->peer.prsctp_capable) {
chunksize += sizeof(prsctp_param);
extensions[num_ext] = SCTP_CID_FWD_TSN;
num_ext += 1;
}

if (sctp_addip_enable) {
extensions[num_ext] = SCTP_CID_ASCONF;
extensions[num_ext+1] = SCTP_CID_ASCONF_ACK;
num_ext += 2;
}

chunksize += sizeof(ext_param) + num_ext;
chunksize += sizeof(aiparam);

if (asoc->peer.auth_capable) {
Expand All @@ -407,6 +397,9 @@ struct sctp_chunk *sctp_make_init_ack(const struct sctp_association *asoc,
num_ext += 1;
}

if (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);
if (!retval)
Expand All @@ -428,7 +421,7 @@ struct sctp_chunk *sctp_make_init_ack(const struct sctp_association *asoc,
htons(sizeof(sctp_supported_ext_param_t) + num_ext);
sctp_addto_chunk(retval, sizeof(sctp_supported_ext_param_t),
&ext_param);
sctp_addto_chunk(retval, num_ext, extensions);
sctp_addto_param(retval, num_ext, extensions);
}
if (asoc->peer.prsctp_capable)
sctp_addto_chunk(retval, sizeof(prsctp_param), &prsctp_param);
Expand Down

0 comments on commit 6d01723

Please sign in to comment.