gethostnamadr.c (145687) | gethostnamadr.c (145728) |
---|---|
1/*- 2 * Copyright (c) 1994, Garrett Wollman 3 * 4 * Redistribution and use in source and binary forms, with or without 5 * modification, are permitted provided that the following conditions 6 * are met: 7 * 1. Redistributions of source code must retain the above copyright 8 * notice, this list of conditions and the following disclaimer. --- 10 unchanged lines hidden (view full) --- 19 * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) 20 * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT 21 * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY 22 * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF 23 * SUCH DAMAGE. 24 */ 25 26#include <sys/cdefs.h> | 1/*- 2 * Copyright (c) 1994, Garrett Wollman 3 * 4 * Redistribution and use in source and binary forms, with or without 5 * modification, are permitted provided that the following conditions 6 * are met: 7 * 1. Redistributions of source code must retain the above copyright 8 * notice, this list of conditions and the following disclaimer. --- 10 unchanged lines hidden (view full) --- 19 * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) 20 * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT 21 * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY 22 * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF 23 * SUCH DAMAGE. 24 */ 25 26#include <sys/cdefs.h> |
27__FBSDID("$FreeBSD: head/lib/libc/net/gethostnamadr.c 145687 2005-04-29 19:55:23Z ume $"); | 27__FBSDID("$FreeBSD: head/lib/libc/net/gethostnamadr.c 145728 2005-04-30 20:07:01Z ume $"); |
28 29#include "namespace.h" 30#include "reentrant.h" 31#include <sys/param.h> 32#include <sys/socket.h> 33#include <netinet/in.h> 34#include <arpa/inet.h> 35#include <netdb.h> --- 223 unchanged lines hidden (view full) --- 259 260 static const ns_dtab dtab[] = { 261 NS_FILES_CB(_ht_gethostbyaddr, NULL) 262 { NSSRC_DNS, _dns_gethostbyaddr, NULL }, 263 NS_NIS_CB(_nis_gethostbyaddr, NULL) /* force -DHESIOD */ 264 { 0 } 265 }; 266 | 28 29#include "namespace.h" 30#include "reentrant.h" 31#include <sys/param.h> 32#include <sys/socket.h> 33#include <netinet/in.h> 34#include <arpa/inet.h> 35#include <netdb.h> --- 223 unchanged lines hidden (view full) --- 259 260 static const ns_dtab dtab[] = { 261 NS_FILES_CB(_ht_gethostbyaddr, NULL) 262 { NSSRC_DNS, _dns_gethostbyaddr, NULL }, 263 NS_NIS_CB(_nis_gethostbyaddr, NULL) /* force -DHESIOD */ 264 { 0 } 265 }; 266 |
267 if ((_res.options & RES_INIT) == 0 && res_init() == -1) { 268 h_errno = NETDB_INTERNAL; 269 return -1; 270 } 271 |
|
267 if (af == AF_INET6 && len == IN6ADDRSZ) { 268 addr6 = (const struct in6_addr *)(const void *)uaddr; 269 if (IN6_IS_ADDR_LINKLOCAL(addr6)) { 270 h_errno = HOST_NOT_FOUND; 271 return -1; 272 } 273 if (IN6_IS_ADDR_V4MAPPED(addr6) || 274 IN6_IS_ADDR_V4COMPAT(addr6)) { --- 99 unchanged lines hidden --- | 272 if (af == AF_INET6 && len == IN6ADDRSZ) { 273 addr6 = (const struct in6_addr *)(const void *)uaddr; 274 if (IN6_IS_ADDR_LINKLOCAL(addr6)) { 275 h_errno = HOST_NOT_FOUND; 276 return -1; 277 } 278 if (IN6_IS_ADDR_V4MAPPED(addr6) || 279 IN6_IS_ADDR_V4COMPAT(addr6)) { --- 99 unchanged lines hidden --- |