diff options
Diffstat (limited to 'source4/smb_server')
-rw-r--r-- | source4/smb_server/management.c | 17 |
1 files changed, 9 insertions, 8 deletions
diff --git a/source4/smb_server/management.c b/source4/smb_server/management.c index e58c278613..b8e42aec40 100644 --- a/source4/smb_server/management.c +++ b/source4/smb_server/management.c @@ -25,6 +25,7 @@ #include "lib/messaging/irpc.h" #include "librpc/gen_ndr/ndr_irpc.h" #include "auth/auth.h" +#include "lib/tsocket/tsocket.h" /* return a list of open sessions @@ -34,9 +35,15 @@ static NTSTATUS smbsrv_session_information(struct irpc_message *msg, { struct smbsrv_connection *smb_conn = talloc_get_type(msg->private_data, struct smbsrv_connection); + struct tsocket_address *client_addr = smb_conn->connection->remote_address; + char *client_addr_string; int i=0, count=0; struct smbsrv_session *sess; + /* This is for debugging only! */ + client_addr_string = tsocket_address_string(client_addr, r); + NT_STATUS_HAVE_NO_MEMORY(client_addr_string); + /* count the number of sessions */ for (sess=smb_conn->sessions.list; sess; sess=sess->next) { count++; @@ -48,14 +55,8 @@ static NTSTATUS smbsrv_session_information(struct irpc_message *msg, for (sess=smb_conn->sessions.list; sess; sess=sess->next) { struct smbsrv_session_info *info = &r->out.info.sessions.sessions[i]; - struct socket_address *client_addr; - client_addr = socket_get_peer_addr(smb_conn->connection->socket, r); - - if (client_addr) { - info->client_ip = client_addr->addr; - } else { - info->client_ip = NULL; - } + + info->client_ip = client_addr_string; info->vuid = sess->vuid; info->account_name = sess->session_info->server_info->account_name; |