The Samba-Bugzilla – Attachment 4157 Details for
Bug 6360
smbd logs nuisance host name/address mismatch errors
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Requests
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
Proposed fix for IPv6-related name/address mismatch
samba-3.3.4-matchname.patch (text/plain), 2.69 KB, created by
Ole Hansen
on 2009-05-14 13:25:11 UTC
(
hide
)
Description:
Proposed fix for IPv6-related name/address mismatch
Filename:
MIME Type:
Creator:
Ole Hansen
Created:
2009-05-14 13:25:11 UTC
Size:
2.69 KB
patch
obsolete
>--- samba-3.3.4/source/lib/util_sock.c 2009-04-28 02:46:16.000000000 -0400 >+++ samba-3.3.4/source/lib/util_sock.c.matchname 2009-05-13 13:51:22.000000000 -0400 >@@ -98,12 +98,13 @@ > ******************************************************************/ > > static bool interpret_string_addr_internal(struct addrinfo **ppres, >- const char *str, int flags) >+ const char *str, int family, int flags) > { > int ret; > struct addrinfo hints; > > memset(&hints, '\0', sizeof(hints)); >+ hints.ai_family = family; > /* By default make sure it supports TCP. */ > hints.ai_socktype = SOCK_STREAM; > hints.ai_flags = flags; >@@ -117,8 +118,9 @@ > > if (ret) { > DEBUG(3,("interpret_string_addr_internal: getaddrinfo failed " >- "for name %s [%s]\n", >+ "for name %s family %d [%s]\n", > str, >+ family, > gai_strerror(ret) )); > return false; > } >@@ -154,6 +156,7 @@ > struct addrinfo *res_list = NULL; > if (!interpret_string_addr_internal(&res_list, > str, >+ AF_INET, > AI_ADDRCONFIG)) { > DEBUG(3,("interpret_addr: Unknown host. %s\n",str)); > return 0; >@@ -222,7 +225,7 @@ > > /* > * Cope with link-local. >- * This is IP:v6:addr%ifname. >+ * This is IPv6:addr%ifname. > */ > > if (p && (p > str) && ((scope_id = if_nametoindex(p+1)) != 0)) { >@@ -236,7 +239,7 @@ > > zero_sockaddr(pss); > >- if (!interpret_string_addr_internal(&res, str, flags|AI_ADDRCONFIG)) { >+ if (!interpret_string_addr_internal(&res, str, AF_UNSPEC, flags|AI_ADDRCONFIG)) { > return false; > } > if (!res) { >@@ -260,7 +263,7 @@ > } > > /******************************************************************* >- Check if an IPv7 is 127.0.0.1 >+ Check if an IPv4 is 127.0.0.1 > ******************************************************************/ > > bool is_loopback_ip_v4(struct in_addr ip) >@@ -1696,9 +1699,20 @@ > struct addrinfo *res = NULL; > struct addrinfo *ailist = NULL; > char addr_buf[INET6_ADDRSTRLEN]; >- bool ret = interpret_string_addr_internal(&ailist, >- remotehost, >- AI_ADDRCONFIG|AI_CANONNAME); >+ bool ret; >+ int family = pss->ss_family; >+ int flags = AI_ADDRCONFIG|AI_CANONNAME; >+#if defined(HAVE_IPV6) >+ if (family == AF_INET6) { >+ const struct in6_addr *sin6 = >+ &((const struct sockaddr_in6 *)pss)->sin6_addr; >+ if (IN6_IS_ADDR_V4MAPPED(sin6)) { >+ flags |= AI_V4MAPPED|AI_ALL; >+ } >+ } >+#endif >+ ret = interpret_string_addr_internal(&ailist, >+ remotehost, family, flags ); > > if (!ret || ailist == NULL) { > DEBUG(3,("matchname: getaddrinfo failed for " >@@ -2030,7 +2044,7 @@ > my_hostname[sizeof(my_hostname)-1] = '\0'; > > ret = interpret_string_addr_internal(&res, >- my_hostname, >+ my_hostname, AF_UNSPEC, > AI_ADDRCONFIG|AI_CANONNAME); > > if (!ret || res == NULL) {
You cannot view the attachment while viewing its details because your browser does not support IFRAMEs.
View the attachment on a separate page
.
View Attachment As Raw
Actions:
View
Attachments on
bug 6360
: 4157