diff options
author | Jeremy Allison <jra@samba.org> | 2007-10-02 19:27:25 +0000 |
---|---|---|
committer | Gerald (Jerry) Carter <jerry@samba.org> | 2007-10-10 12:31:06 -0500 |
commit | 3fbd1ae54ced2eb889a8fe0a6ea32dfd8175f941 (patch) | |
tree | a39948ec0633b6bed73df92ddc0c94dc4c607f12 /source3/lib/util.c | |
parent | 5c5acae0eee9fb113ac6817eb8a164551a1cb117 (diff) | |
download | samba-3fbd1ae54ced2eb889a8fe0a6ea32dfd8175f941.tar.gz samba-3fbd1ae54ced2eb889a8fe0a6ea32dfd8175f941.tar.xz samba-3fbd1ae54ced2eb889a8fe0a6ea32dfd8175f941.zip |
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)
Diffstat (limited to 'source3/lib/util.c')
-rw-r--r-- | source3/lib/util.c | 26 |
1 files changed, 13 insertions, 13 deletions
diff --git a/source3/lib/util.c b/source3/lib/util.c index 67c5f8d38f2..6c86376e57c 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<n; i++) { - if (ip == nics[i].ip.s_addr) + if (ip == nics[i].iface_addr.ip.s_addr) return True; } - } + } /* no match */ return False; @@ -2217,14 +2217,14 @@ BOOL is_myworkgroup(const char *s) WinXP => "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 ) |