From 3fbd1ae54ced2eb889a8fe0a6ea32dfd8175f941 Mon Sep 17 00:00:00 2001 From: Jeremy Allison Date: Tue, 2 Oct 2007 19:27:25 +0000 Subject: r25472: Fix the interfaces code to detect IPv6 interfaces, using the new standard getifaddrs() and freeifaddrs() interfaces. Currently we only return IPv4 af_families. Needs fixing for binds to IPv6 but this has to be careful work. Jeremy. (This used to be commit 327875182c9219aeba687e10aaea93546d9a70ea) --- source3/lib/util.c | 26 +++++++++++++------------- 1 file changed, 13 insertions(+), 13 deletions(-) (limited to 'source3/lib/util.c') diff --git a/source3/lib/util.c b/source3/lib/util.c index 67c5f8d38f..6c86376e57 100644 --- a/source3/lib/util.c +++ b/source3/lib/util.c @@ -2138,7 +2138,7 @@ BOOL is_myname_or_ipaddr(const char *s) /* optimize for the common case */ - if (strequal(servername, global_myname())) + if (strequal(servername, global_myname())) return True; /* check for an alias */ @@ -2148,10 +2148,10 @@ BOOL is_myname_or_ipaddr(const char *s) /* check for loopback */ - if (strequal(servername, "127.0.0.1")) + if (strequal(servername, "127.0.0.1")) return True; - if (strequal(servername, "localhost")) + if (strequal(servername, "localhost")) return True; /* maybe it's my dns name */ @@ -2159,7 +2159,7 @@ BOOL is_myname_or_ipaddr(const char *s) if ( get_mydnsfullname( dnsname ) ) if ( strequal( servername, dnsname ) ) return True; - + /* handle possible CNAME records */ if ( !is_ipaddress( servername ) ) { @@ -2171,25 +2171,25 @@ BOOL is_myname_or_ipaddr(const char *s) putip( (char*)&return_ip, (char*)hp->h_addr ); fstrcpy( name, inet_ntoa( return_ip ) ); servername = name; - } + } } - + /* maybe its an IP address? */ if (is_ipaddress(servername)) { struct iface_struct nics[MAX_INTERFACES]; int i, n; uint32 ip; - + ip = interpret_addr(servername); if ((ip==0) || (ip==0xffffffff)) return False; - + n = get_interfaces(nics, MAX_INTERFACES); for (i=0; i "Windows 2002 5.1" WinXP 64bit => "Windows XP 5.2" Win2k => "Windows 2000 5.0" - NT4 => "Windows NT 4.0" + NT4 => "Windows NT 4.0" Win9x => "Windows 4.0" - Windows 2003 doesn't set the native lan manager string but + Windows 2003 doesn't set the native lan manager string but they do set the domain to "Windows 2003 5.2" (probably a bug). ********************************************************************/ void ra_lanman_string( const char *native_lanman ) -{ +{ if ( strcmp( native_lanman, "Windows 2002 5.1" ) == 0 ) set_remote_arch( RA_WINXP ); else if ( strcmp( native_lanman, "Windows XP 5.2" ) == 0 ) -- cgit