From fc91aa6988e93ee5a001781d56699e3c1b9684a7 Mon Sep 17 00:00:00 2001 From: Jeremy Allison Date: Fri, 26 Oct 2007 16:03:20 -0700 Subject: Move the horrible hack for link local addresses out of namequery.c and into util_sock.c. is_ipaddress() now copes with link:local:v6%ifname addresses, as does interpret_string_addr(). Jeremy (This used to be commit a3f7db3d30ced566c8340696914f1be3293a9c5b) --- source3/libsmb/namequery.c | 26 -------------------------- 1 file changed, 26 deletions(-) (limited to 'source3/libsmb/namequery.c') diff --git a/source3/libsmb/namequery.c b/source3/libsmb/namequery.c index 90e6be6a90..34fe09b8c2 100644 --- a/source3/libsmb/namequery.c +++ b/source3/libsmb/namequery.c @@ -1594,32 +1594,6 @@ bool resolve_name(const char *name, char *sitename = NULL; int count = 0; -#if defined(HAVE_IPV6) - unsigned int if_idx = 0; - const char *p = strchr_m(name, '%'); - - if (p && (if_idx = if_nametoindex(p+1)) != 0) { - char *newname = SMB_STRDUP(name); - if (!newname) { - return false; - } - newname[PTR_DIFF(p,name)] = '\0'; - if (is_ipaddress(newname) && - interpret_string_addr(return_ss, - newname, AI_NUMERICHOST)) { - struct sockaddr_in6 *psa6 = - (struct sockaddr_in6 *)&return_ss; - if (psa6->sin6_scope_id == 0 && - IN6_IS_ADDR_LINKLOCAL(&psa6->sin6_addr)) { - psa6->sin6_scope_id = if_idx; - } - SAFE_FREE(newname); - return true; - } - SAFE_FREE(newname); - } -#endif - if (is_ipaddress(name)) { return interpret_string_addr(return_ss, name, AI_NUMERICHOST); } -- cgit