udp: preserve the connected status if only UDP cmsg
authorYick Xie <yick.xie@gmail.com>
Thu, 18 Apr 2024 17:06:10 +0000 (01:06 +0800)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Thu, 2 May 2024 14:24:50 +0000 (16:24 +0200)
commite6a488ae31ce07ac8ba048c6e3e198f67fd2bc05
tree985c05c62fea0b20e1ca7de9518ed2a9ae6ddac3
parent93ba36238db6a74a82feb3dc476e25ea424ad630
udp: preserve the connected status if only UDP cmsg

commit 680d11f6e5427b6af1321932286722d24a8b16c1 upstream.

If "udp_cmsg_send()" returned 0 (i.e. only UDP cmsg),
"connected" should not be set to 0. Otherwise it stops
the connected socket from using the cached route.

Fixes: 2e8de8576343 ("udp: add gso segment cmsg")
Signed-off-by: Yick Xie <yick.xie@gmail.com>
Cc: stable@vger.kernel.org
Reviewed-by: Willem de Bruijn <willemb@google.com>
Link: https://lore.kernel.org/r/20240418170610.867084-1-yick.xie@gmail.com
Signed-off-by: Jakub Kicinski <kuba@kernel.org>
Signed-off-by: Yick Xie <yick.xie@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
net/ipv4/udp.c
net/ipv6/udp.c