netdev.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH - SCTP] Fix multihomed connection failures on 64-bit systems.
@ 2004-05-07 21:51 Sridhar Samudrala
  2004-05-08 22:22 ` David S. Miller
  0 siblings, 1 reply; 2+ messages in thread
From: Sridhar Samudrala @ 2004-05-07 21:51 UTC (permalink / raw)
  To: davem; +Cc: netdev, lksctp-developers

Dave,

The following patch from Vladislav Yasevich fixes an SCTP issue with 64-bit
systems.
This applies to 2.4 tree also with a small offset.

[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.

diff -Nru a/net/sctp/associola.c b/net/sctp/associola.c
--- a/net/sctp/associola.c      Fri May  7 14:37:34 2004
+++ b/net/sctp/associola.c      Fri May  7 14:37:34 2004
@@ -1195,7 +1195,7 @@
 {
        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);

^ permalink raw reply	[flat|nested] 2+ messages in thread

* Re: [PATCH - SCTP] Fix multihomed connection failures on 64-bit systems.
  2004-05-07 21:51 [PATCH - SCTP] Fix multihomed connection failures on 64-bit systems Sridhar Samudrala
@ 2004-05-08 22:22 ` David S. Miller
  0 siblings, 0 replies; 2+ messages in thread
From: David S. Miller @ 2004-05-08 22:22 UTC (permalink / raw)
  To: Sridhar Samudrala; +Cc: netdev, lksctp-developers

On Fri, 7 May 2004 14:51:02 -0700 (PDT)
Sridhar Samudrala <sri@us.ibm.com> wrote:

> The following patch from Vladislav Yasevich fixes an SCTP issue with 64-bit
> systems.
> This applies to 2.4 tree also with a small offset.

Please use attachments if your mailer is going to turn tabs
into spaces as this makes the patch not apply cleanly.

I fixed it up by hand this time.

Thanks.

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2004-05-08 22:22 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2004-05-07 21:51 [PATCH - SCTP] Fix multihomed connection failures on 64-bit systems Sridhar Samudrala
2004-05-08 22:22 ` David S. Miller

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).