Nmap Development mailing list archives

Re: DnetName2PcapName bugfix


From: Daniel Miller <bonsaiviking () gmail com>
Date: Sun, 31 May 2015 22:51:56 -0500

Elon,

Thanks for this patch. It looks reasonable, and has been applied as r34553.

Dan

On Fri, Feb 27, 2015 at 5:19 AM, Elon Natovich <elon.nat () gmail com> wrote:

Hi,

First of all I must thank you guys for nmap - thanks for the hard work on
this superb utility!

For a while I've wondered why nmap's initialization is so slow on my
computer ( 64 bit windows 7), and today I've did a little debugging to find
the spot. While initializing the DNS server list [init_servs()] for every
interface in registry, it iterates over every dnet interface name and
uses DnetName2PcapName to get it's GUID to try match it to the interface's
GUID. That means that DnetName2PcapName is called for all dnet names, for
every interface in registry - not so efficient. I saw there was a cache for
DnetName2PcapName translation to solve this issue - but there was no cache
for dnet names not found.

So every time nmap started,it wasted a lot of time trying to resolve dnet
names without matching pcap names (like lo0). Even a simple scan took ~35
seconds, of which ~30 seconds of initialization!

I've added a cache for dnet names not found, now simple scans take me ~5
seconds, and attached the svn diff.

Please tell me if I got something wrong!

Cheers,
Elon Natovich

_______________________________________________
Sent through the dev mailing list
https://nmap.org/mailman/listinfo/dev
Archived at http://seclists.org/nmap-dev/

_______________________________________________
Sent through the dev mailing list
https://nmap.org/mailman/listinfo/dev
Archived at http://seclists.org/nmap-dev/

Current thread: