37 lines
1.2 KiB
Plaintext
37 lines
1.2 KiB
Plaintext
$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);
|
|
|