[SCM] Samba Shared Repository - branch v3-3-test updated - release-3-2-0pre2-4211-g17c9f88

Gerald Carter jerry at samba.org
Fri Oct 3 16:01:10 GMT 2008


The branch, v3-3-test has been updated
       via  17c9f8810598d8117befc896d12a597a52b0ac3b (commit)
       via  6b6402bce318a48b0890ed6fc23ed5b30440927b (commit)
      from  89df6afb7a16feb1a0b186965ff37a1f8990bcca (commit)

http://gitweb.samba.org/?p=samba.git;a=shortlog;h=v3-3-test


- Log -----------------------------------------------------------------
commit 17c9f8810598d8117befc896d12a597a52b0ac3b
Author: Gerald (Jerry) Carter <jerry at samba.org>
Date:   Fri Oct 3 10:51:54 2008 -0500

    net_dns: Make "lwinet ads dns register" honor the "interfaces" parameter.
    
    This is helpful on multihomed hosts that only require a subset
    of IP addresses be registered with DNS.

commit 6b6402bce318a48b0890ed6fc23ed5b30440927b
Author: Gerald (Jerry) Carter <jerry at samba.org>
Date:   Fri Oct 3 10:51:21 2008 -0500

    libaddns: Use the same prerequisite for DDNS update as Windows XP.
    
       Hostname, TYPE: CNAME, CLASS: NONE
    
    This has to have been broken for ages.  I cannot see
    how it would have worked in any environment.

-----------------------------------------------------------------------

Summary of changes:
 source/libaddns/dnsrecord.c |    4 ++--
 source/utils/net_dns.c      |   25 ++++++++++++-------------
 2 files changed, 14 insertions(+), 15 deletions(-)


Changeset truncated at 500 lines:

diff --git a/source/libaddns/dnsrecord.c b/source/libaddns/dnsrecord.c
index 500cbd6..559c264 100644
--- a/source/libaddns/dnsrecord.c
+++ b/source/libaddns/dnsrecord.c
@@ -378,10 +378,10 @@ DNS_ERROR dns_create_update_request(TALLOC_CTX *mem_ctx,
 	if (!ERR_DNS_IS_OK(err)) return err;
 
 	/*
-	 * The zone must be used at all
+	 * Use the same prereq as WinXP -- No CNAME records for this host.
 	 */
 
-	err = dns_create_rrec(req, domainname, QTYPE_ANY, DNS_CLASS_ANY,
+	err = dns_create_rrec(req, hostname, QTYPE_CNAME, DNS_CLASS_NONE,
 			      0, 0, NULL, &rec);
 	if (!ERR_DNS_IS_OK(err)) goto error;
 
diff --git a/source/utils/net_dns.c b/source/utils/net_dns.c
index 14d45e2..46f38d4 100644
--- a/source/utils/net_dns.c
+++ b/source/utils/net_dns.c
@@ -150,9 +150,10 @@ int get_my_ip_address( struct sockaddr_storage **pp_ss )
 	struct sockaddr_storage *list = NULL;
 	int count = 0;
 
-	/* find the first non-loopback address from our list of interfaces */
+	/* Honor the configured list of interfaces to register */
 
-	n = get_interfaces(nics, MAX_INTERFACES);
+	load_interfaces();
+	n = iface_count();
 
 	if (n <= 0) {
 		return -1;
@@ -163,19 +164,17 @@ int get_my_ip_address( struct sockaddr_storage **pp_ss )
 	}
 
 	for ( i=0; i<n; i++ ) {
-		if (is_loopback_addr(&nics[i].ip)) {
+		const struct sockaddr_storage *nic_sa_storage = NULL;
+
+		if ((nic_sa_storage = iface_n_sockaddr_storage(i)) == NULL)
+			continue;
+
+		/* Don't register loopback addresses */
+		if (is_loopback_addr(nic_sa_storage)) {
 			continue;
 		}
-#if defined(HAVE_IPV6)
-		if ((nics[i].ip.ss_family == AF_INET6)) {
-			memcpy(&list[count++], &nics[i].ip,
-			       sizeof(struct sockaddr_storage));
-		} else
-#endif
-		if (nics[i].ip.ss_family == AF_INET) {
-			memcpy(&list[count++], &nics[i].ip,
-			       sizeof(struct sockaddr_storage));
-		}
+
+		memcpy(&list[count++], nic_sa_storage, sizeof(struct sockaddr_storage));
 	}
 	*pp_ss = list;
 


-- 
Samba Shared Repository


More information about the samba-cvs mailing list