summaryrefslogtreecommitdiff
path: root/net/ORBit2/patches/patch-ae
blob: 7ce217d01755e107a5c0e5113c6255fbbcf25fab (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
$NetBSD: patch-ae,v 1.1 2008/02/13 19:36:48 drochner Exp $

--- linc2/src/linc-protocols.c.orig	2008-01-30 12:08:40.000000000 +0100
+++ linc2/src/linc-protocols.c
@@ -582,14 +582,20 @@ link_protocol_get_sockaddr_ipv4 (const L
 	if ((saddr->sin_addr.s_addr = inet_addr (hostname)) == INADDR_NONE) {
 	        int i;
 
+#ifndef __NetBSD__ /* don't touch global state */
 		LINK_RESOLV_UNSET_IPV6;
 #ifdef HAVE_RESOLV_H
 		if (!(_res.options & RES_INIT))
 			res_init();
 #endif
+#endif /* NetBSD */
 		
                 d_printf("%s:%s:%d:gethostbyname(%s)\n", __FILE__, __FUNCTION__, __LINE__, hostname);
+#ifdef __NetBSD__
+		host = gethostbyname2 (hostname, AF_INET);
+#else
 		host = gethostbyname (hostname);
+#endif
 		if (!host) {
 		  g_free (saddr);
 		  return NULL;