Changeset 582

Show
Ignore:
Timestamp:
06/25/06 04:24:30 (3 years ago)
Author:
common
Message:

nepenthes

  • module-honeytrap
    • some workarounds for freebsd lamenesses,
      • the pcap manpage states the poll/select on pcap fd may fail on freebsd if the timeout for pcap_open_live is larger than the select/poll timeout and the socket is blocking, as we use nonblocking sockets anyway, just set the timeout to 50 ms, to be sure
      • getsockopt() fails for the pcap fd on freebsd, just return 0.

"

Files:

Legend:

Unmodified
Added
Removed
Modified
Copied
Moved
  • nepenthes/trunk/modules/module-honeytrap/module-honeytrap.cpp

    r578 r582  
    285285 
    286286 
    287         if ( (m_RawListener = pcap_open_live(m_PcapDevice.c_str(), 1500, 1, 0, errbuf)) == NULL ) 
     287        if ( (m_RawListener = pcap_open_live(m_PcapDevice.c_str(), 1500, 1, 50, errbuf)) == NULL ) 
    288288        { 
    289289                logCrit("Could not open raw listener on device %s '%s'\n",m_PcapDevice.c_str(),errbuf); 
     
    489489//              int pcap_stats(pcap_t *p, struct pcap_stat *ps) 
    490490                struct pcap_stat ps; 
     491                memset(&ps,0,sizeof(struct pcap_stat)); 
    491492                if ( pcap_stats(m_RawListener, &ps) != 0 ) 
    492493                { 
     
    784785int32_t ModuleHoneyTrap::getsockOpt(int32_t level, int32_t optname,void *optval,socklen_t *optlen) 
    785786{ 
     787#if defined(linux) || defined(__linux)   
    786788        return getsockopt(getSocket(), level, optname, optval, optlen); 
     789#else 
     790        return 0;        
     791#endif 
    787792} 
    788793