Changeset 429

Show
Ignore:
Timestamp:
07/05/05 09:00:10 (8 years ago)
Author:
ahu
Message:

last bsd-isms

Location:
trunk/pdns/pdns
Files:
3 modified

Legend:

Unmodified
Added
Removed
  • trunk/pdns/pdns/Makefile.am

    r422 r429  
    5252 
    5353dnswasher_SOURCES=dnswasher.cc misc.cc unix_utility.cc qtype.cc \ 
    54         logger.cc statbag.cc  dnspcap.cc dnspcap.hh dnsparser.cc dnsrecords.cc dnsparser.hh  
     54        logger.cc statbag.cc  dnspcap.cc dnspcap.hh dnsparser.hh  
    5555 
    5656dnswasher_LDFLAGS= @THREADFLAGS@ @DYNLINKFLAGS@  
  • trunk/pdns/pdns/dnspcap.cc

    r428 r429  
     1#define __FAVOR_BSD 
    12#include "dnspcap.hh" 
    23#include <boost/format.hpp> 
     4#include <fcntl.h> 
    35 
    46using namespace boost; 
     
    911    unixDie("Unable to open file"); 
    1012   
     13  int flags=fcntl(fileno(d_fp),F_GETFL,0); 
     14  fcntl(fileno(d_fp), F_SETFL,flags&(~O_NONBLOCK)); // bsd needs this in stdin (??) 
    1115   
    1216  checkedFread(&d_pfh); 
     
    6670      d_udp=reinterpret_cast<const struct udphdr*>(d_buffer + sizeof(struct ether_header) + 4 * d_ip->ip_hl); 
    6771      d_payload = (unsigned char*)d_udp + sizeof(struct udphdr); 
    68       d_len = ntohs(d_udp->len) - sizeof(struct udphdr); 
     72      d_len = ntohs(d_udp->uh_ulen) - sizeof(struct udphdr); 
    6973      d_correctpackets++; 
    7074      return true; 
  • trunk/pdns/pdns/dnspcap.hh

    r428 r429  
    11#ifndef PDNS_DNSPCAP_HH 
    22#define PDNS_DNSPCAP_HH 
    3 #define __FAVOR_BSD 
     3 
    44#include <cstdio> 
    55#include <stdexcept> 
     
    77#include "misc.hh" 
    88#include <iostream> 
     9#define __FAVOR_BSD 
    910#include <netinet/in_systm.h> 
    1011#include <netinet/ip.h> 
    1112#include <netinet/udp.h> 
    12 #include <netinet/ether.h> 
     13#include <net/ethernet.h> 
    1314#include <vector> 
    1415#include <pcap.h>