From: Al Viro Date: Tue, 21 Nov 2006 01:02:22 +0000 (-0800) Subject: [SCTP] bug: sctp_assoc_lookup_laddr() is broken with ipv6. X-Git-Url: https://git.stricted.de/?a=commitdiff_plain;h=39940a48c42441da5e7428483ac515e822d52b1d;p=GitHub%2Fmt8127%2Fandroid_kernel_alcatel_ttab.git [SCTP] bug: sctp_assoc_lookup_laddr() is broken with ipv6. It expects (and gets) laddr with net-endian sin_port. And then it calls sctp_bind_addr_match(), which *does* care about port numbers in case of ipv6 and expects them to be host-endian. Signed-off-by: Al Viro Signed-off-by: David S. Miller --- diff --git a/net/sctp/associola.c b/net/sctp/associola.c index a5d7abba89e4..7639044b0074 100644 --- a/net/sctp/associola.c +++ b/net/sctp/associola.c @@ -1335,10 +1335,12 @@ int sctp_assoc_lookup_laddr(struct sctp_association *asoc, const union sctp_addr *laddr) { int found; + union sctp_addr tmp; + flip_to_h(&tmp, laddr); sctp_read_lock(&asoc->base.addr_lock); if ((asoc->base.bind_addr.port == ntohs(laddr->v4.sin_port)) && - sctp_bind_addr_match(&asoc->base.bind_addr, laddr, + sctp_bind_addr_match(&asoc->base.bind_addr, &tmp, sctp_sk(asoc->base.sk))) { found = 1; goto out;