Do not use IP_PKTINFO on NetBSD. Fixes build on NetBSD 7.

This commit is contained in:
fhajny 2014-12-15 12:56:41 +00:00
parent fea0484927
commit a13355b8d3
3 changed files with 40 additions and 1 deletions

View file

@ -1,4 +1,4 @@
$NetBSD: distinfo,v 1.14 2014/12/10 14:50:08 fhajny Exp $
$NetBSD: distinfo,v 1.15 2014/12/15 12:56:41 fhajny Exp $
SHA1 (pdns-3.4.1.tar.bz2) = e4d807b4dc27ef130a49e0efaf82a74cb66f5b11
RMD160 (pdns-3.4.1.tar.bz2) = fe9df921ac82db834bc011c7c20ad9b436c70cec
@ -17,6 +17,8 @@ SHA1 (patch-pdns_dnsparser.hh) = d9480c40b97fb8c7d8f1dbbe1777c42ef270d9d1
SHA1 (patch-pdns_dnsscope.cc) = cc38014e1eb20ed3c65b59714e2725a8283f6391
SHA1 (patch-pdns_dynloader.cc) = 6ef7957917936f077307a4b6c79afe5a4a6ef7c7
SHA1 (patch-pdns_htimer.cc) = 43eb784a58dcad9b3cedca4a6aeae777e33bd2f9
SHA1 (patch-pdns_misc.cc) = 989bd75074f6349b7e0720a490ff99a4af558f6e
SHA1 (patch-pdns_nameserver.cc) = 0b6b888edc0656d9428dda760b4891c0c19f9e47
SHA1 (patch-pdns_pdns_recursor.cc) = df9465d337fceb93caaff7ffc32d17681a8fe77d
SHA1 (patch-pdns_receiver.cc) = 4411bfeccb2814550b834ddabee930918631c666
SHA1 (patch-pdns_recursor__cache.cc) = a4c63c20a3e58d996a631c8a7754b8afb45cdb86

View file

@ -0,0 +1,14 @@
$NetBSD: patch-pdns_misc.cc,v 1.1 2014/12/15 12:56:41 fhajny Exp $
Do not use IP_PKTINFO on NetBSD.
--- pdns/misc.cc.orig 2014-10-30 10:18:22.000000000 +0000
+++ pdns/misc.cc
@@ -802,7 +802,7 @@ void addCMsgSrcAddr(struct msghdr* msgh,
msgh->msg_controllen = cmsg->cmsg_len; // makes valgrind happy and is slightly better style
}
else {
-#ifdef IP_PKTINFO
+#if defined(IP_PKTINFO) && !defined(__NetBSD__)
struct in_pktinfo *pkt;
msgh->msg_control = cmsgbuf;

View file

@ -0,0 +1,23 @@
$NetBSD: patch-pdns_nameserver.cc,v 1.3 2014/12/15 12:56:41 fhajny Exp $
Do not use IP_PKTINFO on NetBSD.
--- pdns/nameserver.cc.orig 2014-10-30 10:18:22.000000000 +0000
+++ pdns/nameserver.cc
@@ -81,7 +81,7 @@ extern StatBag S;
The main() of PowerDNS can be found in receiver.cc - start reading there for further insights into the operation of the nameserver
*/
-#if defined(IP_PKTINFO)
+#if defined(IP_PKTINFO) || !defined(__NetBSD__)
#define GEN_IP_PKTINFO IP_PKTINFO
#elif defined(IP_RECVDSTADDR)
#define GEN_IP_PKTINFO IP_RECVDSTADDR
@@ -337,7 +337,7 @@ static bool HarvestDestinationAddress(st
memset(destination, 0, sizeof(*destination));
struct cmsghdr *cmsg;
for (cmsg = CMSG_FIRSTHDR(msgh); cmsg != NULL; cmsg = CMSG_NXTHDR(msgh,cmsg)) {
-#if defined(IP_PKTINFO)
+#if defined(IP_PKTINFO) || !defined(__NetBSD__)
if ((cmsg->cmsg_level == IPPROTO_IP) && (cmsg->cmsg_type == IP_PKTINFO)) {
struct in_pktinfo *i = (struct in_pktinfo *) CMSG_DATA(cmsg);
destination->sin4.sin_addr = i->ipi_addr;