getaddresses.c (135446) | getaddresses.c (143731) |
---|---|
1/* 2 * Copyright (C) 2004 Internet Systems Consortium, Inc. ("ISC") 3 * Copyright (C) 2001, 2002 Internet Software Consortium. 4 * 5 * Permission to use, copy, modify, and distribute this software for any 6 * purpose with or without fee is hereby granted, provided that the above 7 * copyright notice and this permission notice appear in all copies. 8 * 9 * THE SOFTWARE IS PROVIDED "AS IS" AND ISC DISCLAIMS ALL WARRANTIES WITH 10 * REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY 11 * AND FITNESS. IN NO EVENT SHALL ISC BE LIABLE FOR ANY SPECIAL, DIRECT, 12 * INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM 13 * LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE 14 * OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR 15 * PERFORMANCE OF THIS SOFTWARE. 16 */ 17 | 1/* 2 * Copyright (C) 2004 Internet Systems Consortium, Inc. ("ISC") 3 * Copyright (C) 2001, 2002 Internet Software Consortium. 4 * 5 * Permission to use, copy, modify, and distribute this software for any 6 * purpose with or without fee is hereby granted, provided that the above 7 * copyright notice and this permission notice appear in all copies. 8 * 9 * THE SOFTWARE IS PROVIDED "AS IS" AND ISC DISCLAIMS ALL WARRANTIES WITH 10 * REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY 11 * AND FITNESS. IN NO EVENT SHALL ISC BE LIABLE FOR ANY SPECIAL, DIRECT, 12 * INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM 13 * LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE 14 * OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR 15 * PERFORMANCE OF THIS SOFTWARE. 16 */ 17 |
18/* $Id: getaddresses.c,v 1.13.126.5 2004/05/15 03:46:12 jinmei Exp $ */ | 18/* $Id: getaddresses.c,v 1.13.126.6 2004/09/16 01:00:58 marka Exp $ */ |
19 20#include <config.h> 21#include <string.h> 22 23#include <isc/net.h> 24#include <isc/netaddr.h> 25#include <isc/netdb.h> 26#include <isc/netscope.h> --- 52 unchanged lines hidden (view full) --- 79 */ 80 if (inet_pton(AF_INET, hostname, &in4) == 1) { 81 if (have_ipv4) 82 isc_sockaddr_fromin(&addrs[0], &in4, port); 83 else 84 isc_sockaddr_v6fromin(&addrs[0], &in4, port); 85 *addrcount = 1; 86 return (ISC_R_SUCCESS); | 19 20#include <config.h> 21#include <string.h> 22 23#include <isc/net.h> 24#include <isc/netaddr.h> 25#include <isc/netdb.h> 26#include <isc/netscope.h> --- 52 unchanged lines hidden (view full) --- 79 */ 80 if (inet_pton(AF_INET, hostname, &in4) == 1) { 81 if (have_ipv4) 82 isc_sockaddr_fromin(&addrs[0], &in4, port); 83 else 84 isc_sockaddr_v6fromin(&addrs[0], &in4, port); 85 *addrcount = 1; 86 return (ISC_R_SUCCESS); |
87 } else if (strlen(hostname) <= 127) { | 87 } else if (strlen(hostname) <= 127U) { |
88 char tmpbuf[128], *d; 89 isc_uint32_t zone = 0; 90 91 strcpy(tmpbuf, hostname); 92 d = strchr(tmpbuf, '%'); 93 if (d != NULL) 94 *d = '\0'; 95 --- 134 unchanged lines hidden --- | 88 char tmpbuf[128], *d; 89 isc_uint32_t zone = 0; 90 91 strcpy(tmpbuf, hostname); 92 d = strchr(tmpbuf, '%'); 93 if (d != NULL) 94 *d = '\0'; 95 --- 134 unchanged lines hidden --- |