sctp: Initialize daddr on peeled off socket
authorPetr Malat <oss@malat.biz>
Sat, 9 Apr 2022 06:36:11 +0000 (08:36 +0200)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Wed, 20 Apr 2022 07:34:12 +0000 (09:34 +0200)
commit90c153ca45da86342e1b5105bce1a96ab4f603e2
treeff67bae973aa998cbf81b34fe9c010f513258b04
parent50d46b5ce004a9621bd2842bc53bff58fb15c26d
sctp: Initialize daddr on peeled off socket

[ Upstream commit 8467dda0c26583547731e7f3ea73fc3856bae3bf ]

Function sctp_do_peeloff() wrongly initializes daddr of the original
socket instead of the peeled off socket, which makes getpeername()
return zeroes instead of the primary address. Initialize the new socket
instead.

Fixes: d570ee490fb1 ("[SCTP]: Correctly set daddr for IPv6 sockets during peeloff")
Signed-off-by: Petr Malat <oss@malat.biz>
Acked-by: Marcelo Ricardo Leitner <marcelo.leitner@gmail.com>
Link: https://lore.kernel.org/r/20220409063611.673193-1-oss@malat.biz
Signed-off-by: Jakub Kicinski <kuba@kernel.org>
Signed-off-by: Sasha Levin <sashal@kernel.org>
net/sctp/socket.c