From: Xin Long Date: Sun, 28 Feb 2016 02:03:51 +0000 (+0800) Subject: sctp: lack the check for ports in sctp_v6_cmp_addr X-Git-Tag: v4.1.12-92~15^2~92 X-Git-Url: https://www.infradead.org/git/?a=commitdiff_plain;h=92e88f4f7ddcf90b03804cdc7f6e7f076161f160;p=users%2Fjedix%2Flinux-maple.git sctp: lack the check for ports in sctp_v6_cmp_addr Orabug: 25308045 [ 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 Signed-off-by: David S. Miller Signed-off-by: Sasha Levin (cherry picked from commit 67eab3249eacc0861cf57f6d929e66bf78159379) Signed-off-by: Dhaval Giani --- diff --git a/net/sctp/ipv6.c b/net/sctp/ipv6.c index 3267a5cbb3e86..18361cbfc8820 100644 --- a/net/sctp/ipv6.c +++ b/net/sctp/ipv6.c @@ -519,6 +519,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. */