Commit fbb3aa0d authored by Sridhar Samudrala's avatar Sridhar Samudrala Committed by David S. Miller

[SCTP]: Fix multihomed connection failures on 64-bit systems.

Avoid the use of sizeof() and pointer arithmetic to get to the end
of sctp_cookie structure. Instead use the last element peer_init which
is a zero-sized array as the offset.
parent 6619be03
......@@ -1195,7 +1195,7 @@ int sctp_assoc_set_bind_addr_from_cookie(struct sctp_association *asoc,
{
int var_size2 = ntohs(cookie->peer_init->chunk_hdr.length);
int var_size3 = cookie->raw_addr_list_len;
__u8 *raw = (__u8 *)cookie + sizeof(struct sctp_cookie) + var_size2;
__u8 *raw = (__u8 *)cookie->peer_init + var_size2;
return sctp_raw_to_bind_addrs(&asoc->base.bind_addr, raw, var_size3,
asoc->ep->base.bind_addr.port, gfp);
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment