]> git.ipfire.org Git - thirdparty/samba.git/commitdiff
s4:dsdb/repl: make use of dcerpc_binding_get_string_option("host")
authorStefan Metzmacher <metze@samba.org>
Tue, 4 Feb 2014 11:14:37 +0000 (12:14 +0100)
committerGünther Deschner <gd@samba.org>
Thu, 13 Feb 2014 10:54:17 +0000 (11:54 +0100)
Signed-off-by: Stefan Metzmacher <metze@samba.org>
Reviewed-by: Guenther Deschner <gd@samba.org>
source4/dsdb/repl/drepl_partitions.c

index 815a25996a207adde6e4511a5d5e9159016a6870..7be069e0dc57200fb3cfa43c27e2f4d60beeeb9f 100644 (file)
@@ -297,8 +297,15 @@ WERROR dreplsrv_out_connection_attach(struct dreplsrv_service *s,
 
        hostname = rft->other_info->dns_name;
 
-       for (cur = s->connections; cur; cur = cur->next) {              
-               if (strcmp(cur->binding->host, hostname) == 0) {
+       for (cur = s->connections; cur; cur = cur->next) {
+               const char *host;
+
+               host = dcerpc_binding_get_string_option(cur->binding, "host");
+               if (host == NULL) {
+                       continue;
+               }
+
+               if (strcmp(host, hostname) == 0) {
                        conn = cur;
                        break;
                }
@@ -340,9 +347,9 @@ WERROR dreplsrv_out_connection_attach(struct dreplsrv_service *s,
 
                DLIST_ADD_END(s->connections, conn, struct dreplsrv_out_connection *);
 
-               DEBUG(4,("dreplsrv_out_connection_attach(%s): create\n", conn->binding->host));
+               DEBUG(4,("dreplsrv_out_connection_attach(%s): create\n", hostname));
        } else {
-               DEBUG(4,("dreplsrv_out_connection_attach(%s): attach\n", conn->binding->host));
+               DEBUG(4,("dreplsrv_out_connection_attach(%s): attach\n", hostname));
        }
 
        *_conn = conn;