summaryrefslogtreecommitdiff
path: root/audio/mt-daapd/patches/patch-ad
blob: 9f97319e4805709512a3f6675700fa5ca90313f4 (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
36
$NetBSD: patch-ad,v 1.2 2008/11/23 22:57:05 tron Exp $

--- src/mDNSUNP.c.orig	2008-04-19 20:17:23.000000000 +0100
+++ src/mDNSUNP.c	2008-11-23 22:54:21.000000000 +0000
@@ -88,6 +88,10 @@
 #include <unistd.h>
 #include <stdio.h>
 
+#ifdef __NetBSD__
+#include <sys/param.h>
+#endif
+
 /* Solaris defined SIOCGIFCONF etc in <sys/sockio.h> but 
    other platforms don't even have that include file.  So, 
    if we haven't yet got a definition, let's try to find 
@@ -168,13 +172,19 @@
 		 * have the apple mDNS included, I guess it's a
 		 * small price to pay.
 		 */
-#ifdef FREEBSD
+#if defined (__NetBSD_Version__) && __NetBSD_Version__ >= 499003200	/* NetBSD 4.99.32 */
+		    ptr += (sizeof(ifr->ifr_name) + len) >
+			sizeof(struct ifreq) ?
+			(sizeof(ifr->ifr_name) + len) : sizeof(struct ifreq);
+#else
+#if defined(__FreeBSD__) || defined(__NetBSD__) || defined(__DragonFly__)
 		    ptr += sizeof(ifr->ifr_name) + len; /* for next one in buffer */
 		//		ptr += sizeof(*ifr);
 #else
 
 		    ptr += sizeof(struct ifreq); /* for next one in buffer */
 #endif
+#endif
     
 //        fprintf(stderr, "intf %d name=%s AF=%d\n", index, ifr->ifr_name, ifr->ifr_addr.sa_family);