sctp: lack the check for ports in sctp_v6_cmp_addr
[ Upstream commit 40b4f0fd74 ]
As the member .cmp_addr of sctp_af_inet6, sctp_v6_cmp_addr should also check
the port of addresses, just like sctp_v4_cmp_addr, cause it's invoked by
sctp_cmp_addr_exact().
Now sctp_v6_cmp_addr just check the port when two addresses have different
family, and lack the port check for two ipv6 addresses. that will make
sctp_hash_cmp() cannot work well.
so fix it by adding ports comparison in sctp_v6_cmp_addr().
Signed-off-by: Xin Long <lucien.xin@gmail.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
This commit is contained in:
parent
44bc7d1b97
commit
a87c65252b
1 changed files with 2 additions and 0 deletions
|
|
@ -526,6 +526,8 @@ static int sctp_v6_cmp_addr(const union sctp_addr *addr1,
|
|||
}
|
||||
return 0;
|
||||
}
|
||||
if (addr1->v6.sin6_port != addr2->v6.sin6_port)
|
||||
return 0;
|
||||
if (!ipv6_addr_equal(&addr1->v6.sin6_addr, &addr2->v6.sin6_addr))
|
||||
return 0;
|
||||
/* If this is a linklocal address, compare the scope_id. */
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue