]> git.baikalelectronics.ru Git - kernel.git/commit
cifs: handle hostnames that resolve to same ip in failover
authorPaulo Alcantara <pc@cjr.nz>
Tue, 19 May 2020 18:38:28 +0000 (15:38 -0300)
committerSteve French <stfrench@microsoft.com>
Mon, 1 Jun 2020 05:10:18 +0000 (00:10 -0500)
commit0ea263993b23e4c153c29abd275c5df2a8690fc7
tree9defc68db1e5f5b7de5581b63ec0efb67eb5422f
parentc4e71a7583e140ef5ee8272ba0adb1b4e15ffc9c
cifs: handle hostnames that resolve to same ip in failover

In order to support reconnect to hostnames that resolve to same ip
address, besides relying on the currently set hostname to match DFS
targets, attempt to resolve the targets and then match their addresses
with the reconnected server ip address.

For instance, if we have two hostnames "FOO" and "BAR", and both
resolve to the same ip address, we would be able to handle failover in
DFS paths like

    \\FOO\dfs\link1 -> [ \BAZ\share2 (*), \BAR\share1 ]
    \\FOO\dfs\link2 -> [ \BAZ\share2 (*), \FOO\share1 ]

so when "BAZ" is no longer accessible, link1 and link2 would get
reconnected despite having different target hostnames.

Signed-off-by: Paulo Alcantara (SUSE) <pc@cjr.nz>
Reviewed-by: Aurelien Aptel <aaptel@suse.com>
Signed-off-by: Steve French <stfrench@microsoft.com>
fs/cifs/cifsproto.h
fs/cifs/cifssmb.c
fs/cifs/connect.c
fs/cifs/misc.c
fs/cifs/smb2pdu.c