Skip to content

Commit

Permalink
[SCTP] bug: sctp_assoc_lookup_laddr() is broken with ipv6.
Browse files Browse the repository at this point in the history
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>
  • Loading branch information
Al Viro authored and David S. Miller committed Dec 3, 2006
1 parent 04afd8b commit 39940a4
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion net/sctp/associola.c
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down

0 comments on commit 39940a4

Please sign in to comment.