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)
committerMichael Adam <obnox@samba.org>
Tue, 18 Sep 2018 10:34:34 +0000 (12:34 +0200)
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 7904491489f601dcbdc728bb415b17d0b7eb9f33..9115285cf4ffa2830a26b17b5edb01a29462ee68 100644 (file)
@@ -406,6 +406,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)))