sctp: lack the check for ports in sctp_v6_cmp_addr
authorXin Long <lucien.xin@gmail.com>
Sun, 28 Feb 2016 02:03:51 +0000 (10:03 +0800)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Wed, 20 Apr 2016 06:41:58 +0000 (15:41 +0900)
commita87c65252bb82cc82ed226f70922aa83709ea2fe
tree8ac9a9627d4cdabfa9cd2862a3886dc5e0798659
parent44bc7d1b9777128656310c0c7b47cb952a7c7b2d
sctp: lack the check for ports in sctp_v6_cmp_addr

[ Upstream commit 40b4f0fd74e46c017814618d67ec9127ff20f157 ]

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>
net/sctp/ipv6.c