s4:cldap_server: allow src_address = NULL in fill_netlogon_samlogon_response()
authorStefan Metzmacher <metze@samba.org>
Tue, 27 Apr 2010 08:22:25 +0000 (10:22 +0200)
committerStefan Metzmacher <metze@samba.org>
Tue, 27 Apr 2010 11:00:24 +0000 (13:00 +0200)
If we don't have the client address, we assume it's a local call,
maybe ncalrpc.

metze

source4/cldap_server/netlogon.c

index 1993c1f7dbaf950da62d87ca849b3f000a0e76a4..e24f1b376e28b7de91bdd2fefe11741b7792a856 100644 (file)
@@ -270,8 +270,16 @@ NTSTATUS fill_netlogon_samlogon_response(struct ldb_context *sam_ctx,
                                                  src_address, NULL);
        NT_STATUS_HAVE_NO_MEMORY(client_site);
        load_interfaces(mem_ctx, lp_interfaces(lp_ctx), &ifaces);
-       pdc_ip           = iface_best_ip(ifaces, src_address);
-
+       /*
+        * TODO: the caller should pass the address which the client
+        * used to trigger this call, as the client is able to reach
+        * this ip.
+        */
+       if (src_address) {
+               pdc_ip = iface_best_ip(ifaces, src_address);
+       } else {
+               pdc_ip = iface_n_ip(ifaces, 0);
+       }
        ZERO_STRUCTP(netlogon);
 
        /* check if either of these bits is present */