Skip to content

Commit

Permalink
ksmbd-tools: send bind_interfaces_only parameter to ksmbd server
Browse files Browse the repository at this point in the history
ksmbd server will handle each interfaces and bind_interfaces_only
parameters.

Signed-off-by: Namjae Jeon <linkinjeon@kernel.org>
  • Loading branch information
namjaejeon committed Jan 10, 2025
1 parent e0ae3eb commit 8a3caf3
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 3 deletions.
3 changes: 2 additions & 1 deletion include/linux/ksmbd_server.h
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,8 @@ struct ksmbd_startup_request {
__u32 smb2_max_credits;
__u32 smbd_max_io_size; /* smbd read write size */
__u32 max_connections; /* Number of maximum simultaneous connections */
__u32 reserved[126]; /* Reserved room */
__s8 bind_interfaces_only;
__s8 reserved[503]; /* Reserved room */
__u32 ifc_list_sz;
__s8 ____payload[];
};
Expand Down
5 changes: 3 additions & 2 deletions mountd/ipc.c
Original file line number Diff line number Diff line change
Expand Up @@ -125,8 +125,10 @@ static int ipc_ksmbd_starting_up(void)
int ifc_list_sz = 0;
int ret;

if (global_conf.bind_interfaces_only && global_conf.interfaces)
if (global_conf.bind_interfaces_only && global_conf.interfaces) {
ifc_list_sz += ifc_list_size();
ev->bind_interfaces_only = global_conf.bind_interfaces_only;
}

msg = ipc_msg_alloc(sizeof(*ev) + ifc_list_sz);
if (!msg)
Expand Down Expand Up @@ -192,7 +194,6 @@ static int ipc_ksmbd_starting_up(void)
sz += strlen(p) + 1;
}

global_conf.bind_interfaces_only = 0;
cp_group_kv_list_free(global_conf.interfaces);
}

Expand Down

0 comments on commit 8a3caf3

Please sign in to comment.