[SCM] Samba Shared Repository - branch v4-18-test updated

Stefan Metzmacher metze at samba.org
Fri Jan 5 13:47:01 UTC 2024


The branch, v4-18-test has been updated
       via  9f8a73d7cc4 s3:smbd multichannel: always refresh the network information
      from  c2c111688c4 s3:ctdbd_conn: fix ctdbd_public_ip_foreach() for ipv6 addresses

https://git.samba.org/?p=samba.git;a=shortlog;h=v4-18-test


- Log -----------------------------------------------------------------
commit 9f8a73d7cc4bc0662aa527b045bc9925b9b4c71a
Author: Jones Syue <jonessyue at qnap.com>
Date:   Thu Jan 4 09:42:15 2024 +0800

    s3:smbd multichannel: always refresh the network information
    
    To maintain SMB Multichannel, windows client might periodically query with
    FSCTL_QUERY_NETWORK_INTERFACE_INFO to get SMB server's network information,
    in my case windows server 2022 would do this every 10 minutes (600 seconds).
    
    Consider a scenario: the network information might have changed between
    these queries, some become link down, new interface is link up, network
    speed is changed, and etc. So far smbd might not aware of these changes and
    still report out-of-date network information to windows client, until we
    manually send a SIGHUP to smbd in order to trigger load_interfaces():
    smbd_sig_hup_handler() > reload_services () > load_interfaces()
    This might be a bit inconvenient because it is hard to decide when should
    we manually send a SIGHUP to smbd for refreshing network information.
    
    This patch adds load_interfaces() at fsctl_network_iface_info(), while smbd
    received FSCTL_QUERY_NETWORK_INTERFACE_INFO would go through this and refresh
    local_interfaces, then respond to client with up-to-date network information;
    also refresh num_ifaces to make sure interfaces count is consistent.
    
    BUG: https://bugzilla.samba.org/show_bug.cgi?id=15547
    
    Signed-off-by: Jones Syue <jonessyue at qnap.com>
    Reviewed-by: Stefan Metzmacher <metze at samba.org>
    Reviewed-by: Björn Jacke <bjacke at samba.org>
    (cherry picked from commit 318fd95d5ea63724798592eb6b4eebaecfa0cbfb)
    
    Autobuild-User(v4-18-test): Stefan Metzmacher <metze at samba.org>
    Autobuild-Date(v4-18-test): Fri Jan  5 13:46:39 UTC 2024 on atb-devel-224

-----------------------------------------------------------------------

Summary of changes:
 source3/smbd/smb2_ioctl_network_fs.c | 12 +++++++++++-
 1 file changed, 11 insertions(+), 1 deletion(-)


Changeset truncated at 500 lines:

diff --git a/source3/smbd/smb2_ioctl_network_fs.c b/source3/smbd/smb2_ioctl_network_fs.c
index 5b396855ca6..9ef99dca90f 100644
--- a/source3/smbd/smb2_ioctl_network_fs.c
+++ b/source3/smbd/smb2_ioctl_network_fs.c
@@ -366,7 +366,7 @@ static NTSTATUS fsctl_network_iface_info(TALLOC_CTX *mem_ctx,
 	struct fsctl_net_iface_info *first = NULL;
 	struct fsctl_net_iface_info *last = NULL;
 	size_t i;
-	size_t num_ifaces = iface_count();
+	size_t num_ifaces;
 	enum ndr_err_code ndr_err;
 	struct cluster_movable_ips *cluster_movable_ips = NULL;
 	int ret;
@@ -375,6 +375,16 @@ static NTSTATUS fsctl_network_iface_info(TALLOC_CTX *mem_ctx,
 		return NT_STATUS_INVALID_PARAMETER;
 	}
 
+	/*
+	 * The list of probed interfaces might have changed, we might need to
+	 * refresh local_interfaces to get up-to-date network information, and
+	 * respond to clients which sent FSCTL_QUERY_NETWORK_INTERFACE_INFO.
+	 * For example, network speed is changed, interfaces count is changed
+	 * (some link down or link up), and etc.
+	 */
+	load_interfaces();
+	num_ifaces = iface_count();
+
 	*out_output = data_blob_null;
 
 	array = talloc_zero_array(mem_ctx,


-- 
Samba Shared Repository



More information about the samba-cvs mailing list