summaryrefslogtreecommitdiff
path: root/net/mDNSResponder/patches/patch-ac
blob: 8d9248f23d4b8ac3a752159ff0e43a76723c1e7c (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
26
27
28
29
30
31
32
33
34
35
$NetBSD: patch-ac,v 1.6 2010/07/14 09:29:04 sbd Exp $

* Fix build on FreeBSD and DragonFly, as shown in recent bulk builds and
  PR 34022.
* Don't try to include nonexistant ipv6 header on Solaris.
  From Volker Stolz in PR pkg/34883.

--- mDNSPosix/mDNSUNP.c.orig	2009-01-13 05:31:35.000000000 +0000
+++ mDNSPosix/mDNSUNP.c
@@ -188,7 +188,7 @@ First checkin
     #include <net/if_dl.h>
 #endif
 
-#if defined(AF_INET6) && HAVE_IPV6 && !HAVE_LINUX
+#if defined(AF_INET6) && HAVE_IPV6 && !HAVE_LINUX && !defined(sun)
 #include <net/if_var.h>
 #include <netinet/in_var.h>
 // Note: netinet/in_var.h implicitly includes netinet6/in6_var.h for us
@@ -239,6 +239,8 @@ struct ifi_info *get_ifi_info_linuxv6(in
 					  addr[4],addr[5],addr[6],addr[7],
 					  &index, &plen, &scope, &flags, ifname) != EOF) {
 
+			char ipv6addr[INET6_ADDRSTRLEN];
+
 			myflags = 0;
 			if (strncmp(lastname, ifname, IFNAMSIZ) == 0) {
 				if (doaliases == 0)
@@ -273,7 +275,6 @@ struct ifi_info *get_ifi_info_linuxv6(in
 			memcpy(ifi->ifi_addr, res0->ai_addr, sizeof(struct sockaddr_in6));
 
 			/* Add netmask of the interface */
-			char ipv6addr[INET6_ADDRSTRLEN];
 			plen_to_mask(plen, ipv6addr);
 			ifi->ifi_netmask = calloc(1, sizeof(struct sockaddr_in6));
 			if (ifi->ifi_addr == NULL) {