aboutsummaryrefslogtreecommitdiffstats
path: root/net/sctp/associola.c
diff options
context:
space:
mode:
authorAl Viro <viro@zeniv.linux.org.uk>2006-11-20 20:02:22 -0500
committerDavid S. Miller <davem@sunset.davemloft.net>2006-12-03 00:26:25 -0500
commit39940a48c42441da5e7428483ac515e822d52b1d (patch)
treef6597abfd94ce7b3a0b40b0082361cf6076dc8e9 /net/sctp/associola.c
parent04afd8b282d702bc122051751466000e9513ef96 (diff)
[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 <viro@zeniv.linux.org.uk> Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'net/sctp/associola.c')
-rw-r--r--net/sctp/associola.c4
1 files changed, 3 insertions, 1 deletions
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,
1335 const union sctp_addr *laddr) 1335 const union sctp_addr *laddr)
1336{ 1336{
1337 int found; 1337 int found;
1338 union sctp_addr tmp;
1338 1339
1340 flip_to_h(&tmp, laddr);
1339 sctp_read_lock(&asoc->base.addr_lock); 1341 sctp_read_lock(&asoc->base.addr_lock);
1340 if ((asoc->base.bind_addr.port == ntohs(laddr->v4.sin_port)) && 1342 if ((asoc->base.bind_addr.port == ntohs(laddr->v4.sin_port)) &&
1341 sctp_bind_addr_match(&asoc->base.bind_addr, laddr, 1343 sctp_bind_addr_match(&asoc->base.bind_addr, &tmp,
1342 sctp_sk(asoc->base.sk))) { 1344 sctp_sk(asoc->base.sk))) {
1343 found = 1; 1345 found = 1;
1344 goto out; 1346 goto out;