Nmap Development mailing list archives

Re: libpcap bug workaround for localhost? (Re: pcap_dispatch() returns outgoing packet despite pcap_setfilter)


From: Fyodor <fyodor () insecure org>
Date: Sat, 29 Jan 2005 21:54:48 -0800

On Fri, Jan 14, 2005 at 04:05:56PM +0100, Martin Ma?ok wrote:
void set_pcap_filter(...
[..]
  if (o.debugging)
    log_write(LOG_STDOUT, "Packet capture filter (device %s): %s\n", target->device, buf);
  
  /* Due to apparent bug in libpcap */
  if (islocalhost(target->v4hostip()))
    buf[0] = '\0';
[..]

OK, so, at least, the order of those commands should be reversed.
Second, what is (was?) the bug? It seems to work good on my localhost,
is this workaround still needed?

OK, I've reversed the order for the next version so that the debug
message is correct.  I don't remember the exact bugs I was seeing when
placing a filter on localhost, but I do recall that it was a pain to
track down :).  So I'm not ready to remove that workaround yet.  Nmap
generally assumes that it may get superfluous packets back anyway and
so it checks them again itself.  So the libpcap filters are simply for
efficiency -- allowing some of that filtering to be done earlier.

Cheers,
Fyodor

---------------------------------------------------------------------
For help using this (nmap-dev) mailing list, send a blank email to 
nmap-dev-help () insecure org . List archive: http://seclists.org



Current thread: