From 22cb631b4fd0647b70fbaaafaffda8712a84a999 Mon Sep 17 00:00:00 2001 From: Andrew Bartlett Date: Mon, 2 May 2011 15:57:19 +1000 Subject: s4-interfaces Rename interfaces code so not to conflict with source3/ The iface_count, iface_n_bcast, and load_interfaces functions conflicted with functions of the same name in source3, so the source4 functions were renamed. Hopefully we can actually wrap one around the other in future. Andrew Bartlett --- source4/cldap_server/netlogon.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'source4/cldap_server/netlogon.c') diff --git a/source4/cldap_server/netlogon.c b/source4/cldap_server/netlogon.c index 6e455e46bd7..3f3da8bb416 100644 --- a/source4/cldap_server/netlogon.c +++ b/source4/cldap_server/netlogon.c @@ -291,16 +291,16 @@ NTSTATUS fill_netlogon_samlogon_response(struct ldb_context *sam_ctx, client_site = samdb_client_site_name(sam_ctx, mem_ctx, src_address, NULL); NT_STATUS_HAVE_NO_MEMORY(client_site); - load_interfaces(mem_ctx, lpcfg_interfaces(lp_ctx), &ifaces); + load_interface_list(mem_ctx, lpcfg_interfaces(lp_ctx), &ifaces); /* * 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); + pdc_ip = iface_list_best_ip(ifaces, src_address); } else { - pdc_ip = iface_n_ip(ifaces, 0); + pdc_ip = iface_list_n_ip(ifaces, 0); } ZERO_STRUCTP(netlogon); -- cgit From 40dc94a53f4f0f5dee285daf486912b0996d5f3e Mon Sep 17 00:00:00 2001 From: Andrew Tridgell Date: Thu, 2 Jun 2011 15:40:28 +1000 Subject: s4-ipv6: update callers to load_interface_list() --- source4/cldap_server/netlogon.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'source4/cldap_server/netlogon.c') diff --git a/source4/cldap_server/netlogon.c b/source4/cldap_server/netlogon.c index 3f3da8bb416..e950d70ffc2 100644 --- a/source4/cldap_server/netlogon.c +++ b/source4/cldap_server/netlogon.c @@ -291,7 +291,7 @@ NTSTATUS fill_netlogon_samlogon_response(struct ldb_context *sam_ctx, client_site = samdb_client_site_name(sam_ctx, mem_ctx, src_address, NULL); NT_STATUS_HAVE_NO_MEMORY(client_site); - load_interface_list(mem_ctx, lpcfg_interfaces(lp_ctx), &ifaces); + load_interface_list(mem_ctx, lp_ctx, &ifaces); /* * TODO: the caller should pass the address which the client * used to trigger this call, as the client is able to reach -- cgit From c6252c2e9d9c43496f1b5ecbf66099979096f66e Mon Sep 17 00:00:00 2001 From: Andrew Tridgell Date: Mon, 6 Jun 2011 15:19:16 +1000 Subject: s4-netlogon: force an IPv4 address this interface is currently V4 only, don't try and return a V6 address in a V4 structure --- source4/cldap_server/netlogon.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'source4/cldap_server/netlogon.c') diff --git a/source4/cldap_server/netlogon.c b/source4/cldap_server/netlogon.c index e950d70ffc2..92f7a4a752f 100644 --- a/source4/cldap_server/netlogon.c +++ b/source4/cldap_server/netlogon.c @@ -300,7 +300,7 @@ NTSTATUS fill_netlogon_samlogon_response(struct ldb_context *sam_ctx, if (src_address) { pdc_ip = iface_list_best_ip(ifaces, src_address); } else { - pdc_ip = iface_list_n_ip(ifaces, 0); + pdc_ip = iface_list_first_v4(ifaces); } ZERO_STRUCTP(netlogon); -- cgit From 632f672b0859cee995788a00ecd464a0a8d5c74a Mon Sep 17 00:00:00 2001 From: Andrew Tridgell Date: Tue, 7 Jun 2011 15:46:17 +1000 Subject: s4-cldap: fixed the CLDAP response for IPv6 clients Autobuild-User: Andrew Tridgell Autobuild-Date: Tue Jun 7 08:57:48 CEST 2011 on sn-devel-104 --- source4/cldap_server/netlogon.c | 14 ++++++++------ 1 file changed, 8 insertions(+), 6 deletions(-) (limited to 'source4/cldap_server/netlogon.c') diff --git a/source4/cldap_server/netlogon.c b/source4/cldap_server/netlogon.c index 92f7a4a752f..77f50ff3e66 100644 --- a/source4/cldap_server/netlogon.c +++ b/source4/cldap_server/netlogon.c @@ -37,6 +37,7 @@ #include "param/param.h" #include "../lib/tsocket/tsocket.h" #include "libds/common/flag_mapping.h" +#include "lib/util/util_net.h" /* fill in the cldap netlogon union for a given version @@ -292,16 +293,17 @@ NTSTATUS fill_netlogon_samlogon_response(struct ldb_context *sam_ctx, src_address, NULL); NT_STATUS_HAVE_NO_MEMORY(client_site); load_interface_list(mem_ctx, lp_ctx, &ifaces); - /* - * 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_list_best_ip(ifaces, src_address); } else { pdc_ip = iface_list_first_v4(ifaces); } + if (pdc_ip == NULL || !is_ipaddress_v4(pdc_ip)) { + /* this matches windows behaviour */ + pdc_ip = "127.0.0.1"; + } + ZERO_STRUCTP(netlogon); /* check if either of these bits is present */ @@ -325,7 +327,7 @@ NTSTATUS fill_netlogon_samlogon_response(struct ldb_context *sam_ctx, netlogon->data.nt5_ex.server_site = server_site; netlogon->data.nt5_ex.client_site = client_site; if (version & NETLOGON_NT_VERSION_5EX_WITH_IP) { - /* Clearly this needs to be fixed up for IPv6 */ + /* note that this is always a IPV4 address */ extra_flags = NETLOGON_NT_VERSION_5EX_WITH_IP; netlogon->data.nt5_ex.sockaddr.sockaddr_family = 2; netlogon->data.nt5_ex.sockaddr.pdc_ip = pdc_ip; -- cgit