[SCM] Samba Shared Repository - branch master updated - release-4-0-0alpha6-484-g83cf98f

Steven Danneman sdanneman at samba.org
Thu Feb 5 04:27:21 GMT 2009


The branch, master has been updated
       via  83cf98f113541acca5a9b4d6ad084d401b64706f (commit)
      from  7435b877c7969a72b6b17d3ce4df87c5629882b8 (commit)

http://gitweb.samba.org/?p=samba.git;a=shortlog;h=master


- Log -----------------------------------------------------------------
commit 83cf98f113541acca5a9b4d6ad084d401b64706f
Author: Aravind Srinivasan <aravind.srinivasan at isilon.com>
Date:   Wed Feb 4 16:05:36 2009 -0800

    Have nmbd check all available interfaces for WINS before failing
    
    When nmbd is acting as WINS, it picks the first interface's IP as WINS
    server's IP. If the first interface's IP is zero, we will just quit
    (even though we might have other interfaces with valid IPs).
    
    This patch makes nmbd look at all interfaces and pick the first interface
    with a valid IP as the WINS server's IP.

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

Summary of changes:
 source3/lib/interface.c        |    7 +++++--
 source3/nmbd/nmbd_become_dmb.c |    3 ++-
 source3/nmbd/nmbd_subnetdb.c   |    3 ++-
 3 files changed, 9 insertions(+), 4 deletions(-)


Changeset truncated at 500 lines:

diff --git a/source3/lib/interface.c b/source3/lib/interface.c
index 48fa4d3..b32ccb9 100644
--- a/source3/lib/interface.c
+++ b/source3/lib/interface.c
@@ -151,7 +151,8 @@ int iface_count_v4_nl(void)
 }
 
 /****************************************************************************
- Return a pointer to the in_addr of the first IPv4 interface.
+ Return a pointer to the in_addr of the first IPv4 interface that's
+ not 0.0.0.0.
 **************************************************************************/
 
 const struct in_addr *first_ipv4_iface(void)
@@ -159,7 +160,9 @@ const struct in_addr *first_ipv4_iface(void)
 	struct interface *i;
 
 	for (i=local_interfaces;i ;i=i->next) {
-		if (i->ip.ss_family == AF_INET) {
+		if ((i->ip.ss_family == AF_INET) &&
+		    (!is_zero_ip_v4(((struct sockaddr_in *)&i->ip)->sin_addr)))
+		{
 			break;
 		}
 	}
diff --git a/source3/nmbd/nmbd_become_dmb.c b/source3/nmbd/nmbd_become_dmb.c
index a0b2ef1..827d56c 100644
--- a/source3/nmbd/nmbd_become_dmb.c
+++ b/source3/nmbd/nmbd_become_dmb.c
@@ -128,7 +128,8 @@ in workgroup %s on subnet %s\n",
 
 		work->dmb_name = nmbname;
 
-		/* Pick the first interface IPv4 address as the domain master browser ip. */
+		/* Pick the first interface IPv4 address as the domain master
+		 * browser ip. */
 		nip = first_ipv4_iface();
 		if (!nip) {
 			DEBUG(0,("become_domain_master_stage2: "
diff --git a/source3/nmbd/nmbd_subnetdb.c b/source3/nmbd/nmbd_subnetdb.c
index 61af0bb..13bc931 100644
--- a/source3/nmbd/nmbd_subnetdb.c
+++ b/source3/nmbd/nmbd_subnetdb.c
@@ -287,7 +287,8 @@ bool create_subnets(void)
 	}
 
 	if (lp_we_are_a_wins_server()) {
-		/* Pick the first interface IPv4 address as the WINS server ip. */
+		/* Pick the first interface IPv4 address as the WINS server
+		 * ip. */
 		const struct in_addr *nip = first_ipv4_iface();
 
 		if (!nip) {


-- 
Samba Shared Repository


More information about the samba-cvs mailing list