]> granicus.if.org Git - pdns/commitdiff
closes #1785 - compile on platforms w/o SO_TIMESTAMP
authorbert hubert <bert.hubert@netherlabs.nl>
Tue, 7 Oct 2014 15:14:34 +0000 (17:14 +0200)
committerbert hubert <bert.hubert@netherlabs.nl>
Tue, 7 Oct 2014 15:14:34 +0000 (17:14 +0200)
pdns/misc.cc
pdns/nameserver.cc

index 41fb4525867ad8e14070dcc84b6d785720b081b0..5f28dc966e522c249f64b4fae03e689aa2537bd6 100644 (file)
@@ -910,7 +910,9 @@ uint32_t burtle(const unsigned char* k, uint32_t length, uint32_t initval)
 
 void setSocketTimestamps(int fd)
 {
+#ifdef SO_TIMESTAMP
   int on=1;
   if (setsockopt(fd, SOL_SOCKET, SO_TIMESTAMP, (char*)&on, sizeof(on)) < 0 )
     L<<Logger::Error<<"Warning: unable to enable timestamp reporting for socket"<<endl;
+#endif
 }
index 3a52dd536e410a6c1a8b593b5384dc758afb6610..bb94506f2a0951a14b68cc8e2c540f53f5b3588a 100644 (file)
@@ -338,6 +338,7 @@ void UDPNameserver::send(DNSPacket *p)
 
 static bool HarvestTimestamp(struct msghdr* msgh, struct timeval* tv) 
 {
+#ifdef SO_TIMESTAMP
   struct cmsghdr *cmsg;
   for (cmsg = CMSG_FIRSTHDR(msgh); cmsg != NULL; cmsg = CMSG_NXTHDR(msgh,cmsg)) {
     if ((cmsg->cmsg_level == SOL_SOCKET) && (cmsg->cmsg_type == SO_TIMESTAMP) && 
@@ -346,6 +347,7 @@ static bool HarvestTimestamp(struct msghdr* msgh, struct timeval* tv)
       return true;
     }
   }
+#endif
   return false;
 }