sctp: Initialize daddr on peeled off socket
authorPetr Malat <oss@malat.biz>
Sat, 9 Apr 2022 06:36:11 +0000 (08:36 +0200)
committerJakub Kicinski <kuba@kernel.org>
Tue, 12 Apr 2022 03:33:10 +0000 (20:33 -0700)
commit8467dda0c26583547731e7f3ea73fc3856bae3bf
treed358dd9a2a89aaec91f195858684fad7f709f695
parent65745da171e685b47725bfee138580ad8bf09d8f
sctp: Initialize daddr on peeled off socket

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