]> git.neil.brown.name Git - history.git/commitdiff
[SCTP]: Fix multihomed connection failures on 64-bit systems.
authorSridhar Samudrala <sri@us.ibm.com>
Sat, 8 May 2004 08:23:01 +0000 (01:23 -0700)
committerDavid S. Miller <davem@nuts.davemloft.net>
Sat, 8 May 2004 08:23:01 +0000 (01:23 -0700)
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

index 20b15cc55ed89db365a28ed28c07ccfb7db6c173..a4a86a23e6fc53135226204db717719a0c37efb3 100644 (file)
@@ -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);