From fbb3aa0df16c9a46bd05481cdae42d309fb42dab Mon Sep 17 00:00:00 2001 From: Sridhar Samudrala Date: Sat, 8 May 2004 01:23:01 -0700 Subject: [PATCH] [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. --- net/sctp/associola.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/net/sctp/associola.c b/net/sctp/associola.c index 20b15cc55ed89..a4a86a23e6fc5 100644 --- a/net/sctp/associola.c +++ b/net/sctp/associola.c @@ -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); -- 2.53.0