s3-smbd: use the same TCP keepalive settings as Windows 2012 and 2016
authorGünther Deschner <gd@samba.org>
Wed, 20 Sep 2017 05:50:08 +0000 (07:50 +0200)
committerStefan Metzmacher <metze@samba.org>
Mon, 10 Feb 2020 14:14:02 +0000 (15:14 +0100)
Windows sends 10 keepalives every second after 10 seconds of inactivity
for continously available (CA) shares.

Guenther

Signed-off-by: Guenther Deschner <gd@samba.org>
source3/smbd/smb2_tcon.c

index f3eec55fe6ec37266840956c950e92f105dcbe0b..0c5841afcd4c02c349f29dc0333d2286fe52f3d0 100644 (file)
@@ -414,6 +414,7 @@ static NTSTATUS smbd_smb2_tree_connect(struct smbd_smb2_request *req,
            lp_continuously_available_share(SNUM(tcon->compat)))
        {
                *out_capabilities |= SMB2_SHARE_CAP_CONTINUOUS_AVAILABILITY;
+               set_socket_options_keepalive(conn->transport.sock, 10, 10, 1);
        }
        if (conn->protocol >= PROTOCOL_SMB2_22 &&
            lp_scale_out_share(SNUM(tcon->compat)))