Deleted Added
full compact
sm_gethost.c (223067) sm_gethost.c (249729)
1/*
1/*
2 * Copyright (c) 1999-2001, 2004, 2010 Sendmail, Inc. and its suppliers.
2 * Copyright (c) 1999-2001, 2004, 2010, 2013 Sendmail, Inc. and its suppliers.
3 * All rights reserved.
4 *
5 * By using this file, you agree to the terms and conditions set
6 * forth in the LICENSE file which can be found at the top level of
7 * the sendmail distribution.
8 *
9 */
10
11#include <sm/gen.h>
3 * All rights reserved.
4 *
5 * By using this file, you agree to the terms and conditions set
6 * forth in the LICENSE file which can be found at the top level of
7 * the sendmail distribution.
8 *
9 */
10
11#include <sm/gen.h>
12SM_RCSID("@(#)$Id: sm_gethost.c,v 8.29 2010/07/27 01:09:31 ca Exp $")
12SM_RCSID("@(#)$Id: sm_gethost.c,v 8.30 2013/02/22 22:43:33 gshapiro Exp $")
13
14#include <sendmail.h>
15#if NETINET || NETINET6
16# include <arpa/inet.h>
17#endif /* NETINET || NETINET6 */
18#include "libmilter.h"
19
20/*

--- 75 unchanged lines hidden (view full) ---

96 h = _switch_gethostbyname_r(name, &hp, buf, sizeof(buf), &h_errno);
97# else /* SOLARIS == 20300 || SOLARIS == 203 */
98 extern struct hostent *__switch_gethostbyname();
99
100 h = __switch_gethostbyname(name);
101# endif /* SOLARIS == 20300 || SOLARIS == 203 */
102#else /* (SOLARIS > 10000 && SOLARIS < 20400) || (defined(SOLARIS) && SOLARIS < 204) || (defined(sony_news) && defined(__svr4)) */
103# if NETINET6
13
14#include <sendmail.h>
15#if NETINET || NETINET6
16# include <arpa/inet.h>
17#endif /* NETINET || NETINET6 */
18#include "libmilter.h"
19
20/*

--- 75 unchanged lines hidden (view full) ---

96 h = _switch_gethostbyname_r(name, &hp, buf, sizeof(buf), &h_errno);
97# else /* SOLARIS == 20300 || SOLARIS == 203 */
98 extern struct hostent *__switch_gethostbyname();
99
100 h = __switch_gethostbyname(name);
101# endif /* SOLARIS == 20300 || SOLARIS == 203 */
102#else /* (SOLARIS > 10000 && SOLARIS < 20400) || (defined(SOLARIS) && SOLARIS < 204) || (defined(sony_news) && defined(__svr4)) */
103# if NETINET6
104 int flags = AI_DEFAULT|AI_ALL;
104# ifndef SM_IPNODEBYNAME_FLAGS
105 /* For IPv4-mapped addresses, use: AI_DEFAULT|AI_ALL */
106# define SM_IPNODEBYNAME_FLAGS AI_ADDRCONFIG
107# endif /* SM_IPNODEBYNAME_FLAGS */
108
109 int flags = SM_IPNODEBYNAME_FLAGS;
105 int err;
106# endif /* NETINET6 */
107
108# if NETINET6
109# if ADDRCONFIG_IS_BROKEN
110 flags &= ~AI_ADDRCONFIG;
111# endif /* ADDRCONFIG_IS_BROKEN */
112 h = sm_getipnodebyname(name, family, flags, &err);

--- 38 unchanged lines hidden ---
110 int err;
111# endif /* NETINET6 */
112
113# if NETINET6
114# if ADDRCONFIG_IS_BROKEN
115 flags &= ~AI_ADDRCONFIG;
116# endif /* ADDRCONFIG_IS_BROKEN */
117 h = sm_getipnodebyname(name, family, flags, &err);

--- 38 unchanged lines hidden ---