Deleted Added
full compact
sm_gethost.c (77349) sm_gethost.c (80785)
1/*
2 * Copyright (c) 1999-2001 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#ifndef lint
1/*
2 * Copyright (c) 1999-2001 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#ifndef lint
12static char id[] = "@(#)$Id: sm_gethost.c,v 8.7.8.10 2001/05/09 20:57:12 gshapiro Exp $";
12static char id[] = "@(#)$Id: sm_gethost.c,v 8.7.8.11 2001/07/21 00:10:23 gshapiro Exp $";
13#endif /* ! lint */
14
15#if _FFR_MILTER
16#include <sendmail.h>
17#if NETINET || NETINET6
18# include <arpa/inet.h>
19#endif /* NETINET || NETINET6 */
20

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

26** don't properly deliver a canonical h_name field. This tries to
27** work around these problems.
28**
29** Support IPv6 as well as IPv4.
30*/
31
32#if NETINET6 && NEEDSGETIPNODE
33
13#endif /* ! lint */
14
15#if _FFR_MILTER
16#include <sendmail.h>
17#if NETINET || NETINET6
18# include <arpa/inet.h>
19#endif /* NETINET || NETINET6 */
20

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

26** don't properly deliver a canonical h_name field. This tries to
27** work around these problems.
28**
29** Support IPv6 as well as IPv4.
30*/
31
32#if NETINET6 && NEEDSGETIPNODE
33
34# ifndef AI_V4MAPPED
35# define AI_V4MAPPED 0 /* dummy */
36# endif /* ! AI_V4MAPPED */
34# ifndef AI_ADDRCONFIG
35# define AI_ADDRCONFIG 0 /* dummy */
36# endif /* ! AI_ADDRCONFIG */
37# ifndef AI_ALL
38# define AI_ALL 0 /* dummy */
39# endif /* ! AI_ALL */
37# ifndef AI_ALL
38# define AI_ALL 0 /* dummy */
39# endif /* ! AI_ALL */
40# ifndef AI_DEFAULT
41# define AI_DEFAULT 0 /* dummy */
42# endif /* ! AI_DEFAULT */
40
41static struct hostent *
42getipnodebyname(name, family, flags, err)
43 char *name;
44 int family;
45 int flags;
46 int *err;
47{

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

92 h = _switch_gethostbyname_r(name, &hp, buf, sizeof(buf), &h_errno);
93# else /* SOLARIS == 20300 || SOLARIS == 203 */
94 extern struct hostent *__switch_gethostbyname();
95
96 h = __switch_gethostbyname(name);
97# endif /* SOLARIS == 20300 || SOLARIS == 203 */
98#else /* (SOLARIS > 10000 && SOLARIS < 20400) || (defined(SOLARIS) && SOLARIS < 204) || (defined(sony_news) && defined(__svr4)) */
99# if NETINET6
43
44static struct hostent *
45getipnodebyname(name, family, flags, err)
46 char *name;
47 int family;
48 int flags;
49 int *err;
50{

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

95 h = _switch_gethostbyname_r(name, &hp, buf, sizeof(buf), &h_errno);
96# else /* SOLARIS == 20300 || SOLARIS == 203 */
97 extern struct hostent *__switch_gethostbyname();
98
99 h = __switch_gethostbyname(name);
100# endif /* SOLARIS == 20300 || SOLARIS == 203 */
101#else /* (SOLARIS > 10000 && SOLARIS < 20400) || (defined(SOLARIS) && SOLARIS < 204) || (defined(sony_news) && defined(__svr4)) */
102# if NETINET6
103 int flags = AI_DEFAULT|AI_ALL;
100 int err;
101# endif /* NETINET6 */
102
103# if NETINET6
104 int err;
105# endif /* NETINET6 */
106
107# if NETINET6
104 h = getipnodebyname(name, family, AI_V4MAPPED|AI_ALL, &err);
108# if ADDRCONFIG_IS_BROKEN
109 flags &= ~AI_ADDRCONFIG;
110# endif /* ADDRCONFIG_IS_BROKEN */
111 h = getipnodebyname(name, family, flags, &err);
105 SM_SET_H_ERRNO(err);
106# else /* NETINET6 */
107 h = gethostbyname(name);
108# endif /* NETINET6 */
109
110#endif /* (SOLARIS > 10000 && SOLARIS < 20400) || (defined(SOLARIS) && SOLARIS < 204) || (defined(sony_news) && defined(__svr4)) */
111 return h;
112}
113#endif /* _FFR_MILTER */
112 SM_SET_H_ERRNO(err);
113# else /* NETINET6 */
114 h = gethostbyname(name);
115# endif /* NETINET6 */
116
117#endif /* (SOLARIS > 10000 && SOLARIS < 20400) || (defined(SOLARIS) && SOLARIS < 204) || (defined(sony_news) && defined(__svr4)) */
118 return h;
119}
120#endif /* _FFR_MILTER */