]> git.ipfire.org Git - thirdparty/kernel/stable.git/commit
cifs: use the expiry output of dns_query to schedule next resolution
authorShyam Prasad N <sprasad@microsoft.com>
Tue, 18 May 2021 15:05:50 +0000 (15:05 +0000)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Tue, 20 Jul 2021 14:02:00 +0000 (16:02 +0200)
commit22c018592af57166d2e04870ec878da07444047b
treec7a48e89559543a4870a7419388df1676bac30b6
parent094d3b83a818415339015c4c7ae67955a6dc3762
cifs: use the expiry output of dns_query to schedule next resolution

commit 506c1da44fee32ba1d3a70413289ad58c772bba6 upstream.

We recently fixed DNS resolution of the server hostname during reconnect.
However, server IP address may change, even when the old one continues
to server (although sub-optimally).

We should schedule the next DNS resolution based on the TTL of
the DNS record used for the last resolution. This way, we resolve the
server hostname again when a DNS record expires.

Signed-off-by: Shyam Prasad N <sprasad@microsoft.com>
Reviewed-by: Paulo Alcantara (SUSE) <pc@cjr.nz>
Cc: <stable@vger.kernel.org> # v5.11+
Signed-off-by: Steve French <stfrench@microsoft.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
fs/cifs/cifs_dfs_ref.c
fs/cifs/cifsglob.h
fs/cifs/connect.c
fs/cifs/dns_resolve.c
fs/cifs/dns_resolve.h
fs/cifs/misc.c