Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 19025
b: refs/heads/master
c: 9834a2b
h: refs/heads/master
i:
  19023: 07ae480
v: v3
  • Loading branch information
Vlad Yasevich authored and Sridhar Samudrala committed Jan 17, 2006
1 parent 3068c74 commit f9bd6fd
Show file tree
Hide file tree
Showing 3 changed files with 15 additions and 4 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: 7a48f923b8b27bfaa5f7b2a449a6fe268724ddd5
refs/heads/master: 9834a2bb4970547540222fcba04e0a37d04cb0a0
3 changes: 2 additions & 1 deletion trunk/include/net/sctp/structs.h
Original file line number Diff line number Diff line change
Expand Up @@ -405,8 +405,9 @@ struct sctp_cookie {
/* The format of our cookie that we send to our peer. */
struct sctp_signed_cookie {
__u8 signature[SCTP_SECRET_SIZE];
__u32 __pad; /* force sctp_cookie alignment to 64 bits */
struct sctp_cookie c;
};
} __attribute__((packed));

/* This is another convenience type to allocate memory for address
* params for the maximum size and pass such structures around
Expand Down
14 changes: 12 additions & 2 deletions trunk/net/sctp/sm_make_chunk.c
Original file line number Diff line number Diff line change
Expand Up @@ -1275,7 +1275,12 @@ static sctp_cookie_param_t *sctp_pack_cookie(const struct sctp_endpoint *ep,
unsigned int keylen;
char *key;

headersize = sizeof(sctp_paramhdr_t) + SCTP_SECRET_SIZE;
/* Header size is static data prior to the actual cookie, including
* any padding.
*/
headersize = sizeof(sctp_paramhdr_t) +
(sizeof(struct sctp_signed_cookie) -
sizeof(struct sctp_cookie));
bodysize = sizeof(struct sctp_cookie)
+ ntohs(init_chunk->chunk_hdr->length) + addrs_len;

Expand Down Expand Up @@ -1362,7 +1367,12 @@ struct sctp_association *sctp_unpack_cookie(
struct sk_buff *skb = chunk->skb;
struct timeval tv;

headersize = sizeof(sctp_chunkhdr_t) + SCTP_SECRET_SIZE;
/* Header size is static data prior to the actual cookie, including
* any padding.
*/
headersize = sizeof(sctp_chunkhdr_t) +
(sizeof(struct sctp_signed_cookie) -
sizeof(struct sctp_cookie));
bodysize = ntohs(chunk->chunk_hdr->length) - headersize;
fixed_size = headersize + sizeof(struct sctp_cookie);

Expand Down

0 comments on commit f9bd6fd

Please sign in to comment.