]> git.proxmox.com Git - mirror_ubuntu-zesty-kernel.git/commit
sctp: set sin_port for addr param when checking duplicate address
authorXin Long <lucien.xin@gmail.com>
Fri, 24 Feb 2017 07:18:46 +0000 (15:18 +0800)
committerTim Gardner <tim.gardner@canonical.com>
Wed, 22 Mar 2017 14:02:34 +0000 (08:02 -0600)
commit84f89f2b5768624ceb860b5ca0fc6e12b0e80143
tree415a8a2ee83ad0b278a9e541864fc3be4ec8fc8d
parentd3f1f13bbac80333042dd992e6eabe9f9be74abb
sctp: set sin_port for addr param when checking duplicate address

BugLink: http://bugs.launchpad.net/bugs/1675032
[ Upstream commit 2e3ce5bc2aa938653c3866aa7f4901a1f199b1c8 ]

Commit b8607805dd15 ("sctp: not copying duplicate addrs to the assoc's
bind address list") tried to check for duplicate address before copying
to asoc's bind_addr list from global addr list.

But all the addrs' sin_ports in global addr list are 0 while the addrs'
sin_ports are bp->port in asoc's bind_addr list. It means even if it's
a duplicate address, af->cmp_addr will still return 0 as the their
sin_ports are different.

This patch is to fix it by setting the sin_port for addr param with
bp->port before comparing the addrs.

Fixes: b8607805dd15 ("sctp: not copying duplicate addrs to the assoc's bind address list")
Reported-by: Wei Chen <weichen@redhat.com>
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>
Signed-off-by: Tim Gardner <tim.gardner@canonical.com>
net/sctp/protocol.c