s3:lib/netapi: make use of cli_state_remote_name()
authorStefan Metzmacher <metze@samba.org>
Fri, 22 Jul 2011 14:19:00 +0000 (16:19 +0200)
committerStefan Metzmacher <metze@samba.org>
Fri, 22 Jul 2011 15:06:09 +0000 (17:06 +0200)
metze

source3/lib/netapi/cm.c

index d41a5caf5a519b13cb1e204b73099c0a8756618a..251e98c2c251acd308a9af8db31207d09e55b8cc 100644 (file)
@@ -48,7 +48,9 @@ static struct client_ipc_connection *ipc_cm_find(
        struct client_ipc_connection *p;
 
        for (p = priv_ctx->ipc_connections; p; p = p->next) {
-               if (strequal(p->cli->desthost, server_name)) {
+               const char *remote_name = cli_state_remote_name(p->cli);
+
+               if (strequal(remote_name, server_name)) {
                        return p;
                }
        }
@@ -164,12 +166,15 @@ static NTSTATUS pipe_cm_find(struct client_ipc_connection *ipc,
        struct client_pipe_connection *p;
 
        for (p = ipc->pipe_connections; p; p = p->next) {
+               const char *ipc_remote_name;
 
                if (!rpc_pipe_np_smb_conn(p->pipe)) {
                        return NT_STATUS_PIPE_EMPTY;
                }
 
-               if (strequal(ipc->cli->desthost, p->pipe->desthost)
+               ipc_remote_name = cli_state_remote_name(ipc->cli);
+
+               if (strequal(ipc_remote_name, p->pipe->desthost)
                    && ndr_syntax_id_equal(&p->pipe->abstract_syntax,
                                           interface)) {
                        *presult = p->pipe;