libdnet icon indicating copy to clipboard operation
libdnet copied to clipboard

Investigate modifications applied by Nmap

Open florianernst opened this issue 2 years ago • 5 comments

Hello there,

I couldn't find whether this has already been covered, so filing an issue just to be sure. Apologies in advance if this is a known topic.

Nmap ships their own stripped-down version of libdnet, based on libdnet 1.12, but with additional modifications as outlined in their NMAP_MODIFICATIONS. Those mostly seem to deal with win32 compatibility, and yet that might still be worth checking out whether it provides any additional value for libdnet in general. Also there is some IVMPv6 coverage as per RFC 4443, and Daniel Roethlisberger's SCTP addition that is part of libdnet 1.14 is included as well, just as is crc32ct.h and several other changes.

Nmap allows building against a system version of libdnet, but in their configure.ac they specifically advise against it while stating

[...]
# Unlike the other included libraries (pcap, pcre, lua), we prefer our local
# copy of libdnet. That is, with the other libraries we check for a system
# version by default, whereas with dnet we use the local version unless
# specifically asked to use a system version.  This is because we have
# made many improvements and fixes to our version of dnet.
AC_ARG_WITH(libdnet,
AC_HELP_STRING([--with-libdnet=DIR], [Use an existing (compiled) dnet lib from DIR/include and DIR/lib. This is NOT RECOMMENDED because we have made many important fixes to our included libdnet, as described at ./libdnet-stripped/NMAP_MODIFICATIONS])
AC_HELP_STRING([--with-libdnet=included], [Use the libdnet version included with Nmap (default)]),
[...]

Cheers, Flo

florianernst avatar Mar 04 '22 20:03 florianernst

I'd love to see the (relevant) changes included in our upstream project, but I'd need someone who actually provides the pull request against the current HEAD.

ofalk avatar Apr 05 '22 08:04 ofalk

Are there any nmap developers out there, willing to look into this? Help would be greatly appreciated!

ofalk avatar Jan 11 '23 15:01 ofalk

@florianernst Not sure if you've seen the latest comments, hence mentioning you here explicitly.

ofalk avatar Apr 18 '23 19:04 ofalk

Well, preparing pull requests that actually make sense means making up my mind about which parts of the many many changes Nmap applied to their copy of libdnet as listed in their NMAP_MODIFICATIONS preferably should become part of upstream after all.

And I strongly feel I - for one, being a mere libdnet user - cannot make that call, and thus I was merely pointing to the changes.

florianernst avatar Apr 30 '23 12:04 florianernst

I completely understand @florianernst that you don't want to decide which parts of the NMAP modifications shall be pulled in. The idea was more about: If there are any particular changes that you'd like to be pulled, then I'd appreciate if you could create the PRs accordingly.

ofalk avatar May 15 '23 18:05 ofalk