]> git.ipfire.org Git - thirdparty/kernel/linux.git/commit
smb: client: fix iface port assignment in parse_server_interfaces
authorHenrique Carvalho <henrique.carvalho@suse.com>
Wed, 11 Mar 2026 23:17:23 +0000 (20:17 -0300)
committerSteve French <stfrench@microsoft.com>
Wed, 11 Mar 2026 23:46:28 +0000 (18:46 -0500)
commitd4c7210d2f3ea481a6481f03040a64d9077a6172
tree5a870c3034a913e85fea7b7c89a78cebe81820bb
parent88d37abb366be95d772ceb4c7f26772e78447252
smb: client: fix iface port assignment in parse_server_interfaces

parse_server_interfaces() initializes interface socket addresses with
CIFS_PORT. When the mount uses a non-default port this overwrites the
configured destination port.

Later, cifs_chan_update_iface() copies this sockaddr into server->dstaddr,
causing reconnect attempts to use the wrong port after server interface
updates.

Use the existing port from server->dstaddr instead.

Cc: stable@vger.kernel.org
Fixes: fe856be475f7 ("CIFS: parse and store info on iface queries")
Tested-by: Dr. Thomas Orgis <thomas.orgis@uni-hamburg.de>
Reviewed-by: Enzo Matsumiya <ematsumiya@suse.de>
Signed-off-by: Henrique Carvalho <henrique.carvalho@suse.com>
Signed-off-by: Steve French <stfrench@microsoft.com>
fs/smb/client/smb2ops.c