1
0
mirror of https://github.com/nmap/nmap.git synced 2025-12-06 04:31:29 +00:00
david b2a1ff8e54 Fix broken protocol lookup.
For some reason (probably by imitation of nmap_getservbyport), protocol
numbers, which are byte values 0–255, had htons called on them after
being read from nmap-protocols. On little-endian platforms, this turned
them into integers 0x0100, 0x0200, 0x0300, etc.

protocol_table is supposed to be an array of 256 linked lists, linking
all the protocol names of the same number. Because of the above htons
conversion, all protocols mapped to bucket 0 on lookup instead. Perhaps
in an attempt to work around this broken lookup, all protocols were
inserted into bucket 0 on init; all other buckets were empty. This
worked on little-endian platforms, but on big-endian platforms where
htons is a no-op, all protocol numbers but 0 mapped to an empty linked
list.

Remove all the htons stuff and just look things up by integers. Use the
same mapping on initial insertion and on lookup, so that the buckets are
acutally populated.

This was noticed by hejianet.
http://seclists.org/nmap-dev/2012/q3/1005
2012-09-25 05:08:09 +00:00
2012-08-02 18:35:36 +00:00
2012-09-25 05:08:09 +00:00
2012-09-23 21:15:20 +00:00
2012-09-24 22:56:32 +00:00
2012-05-27 08:53:32 +00:00
2012-03-07 17:59:55 +00:00
2012-08-28 07:50:09 +00:00
2012-09-18 09:02:29 +00:00
2012-09-20 19:21:34 +00:00
2012-09-25 05:08:09 +00:00
2012-08-28 13:07:19 +00:00
2012-05-27 08:53:32 +00:00
2008-07-31 14:18:21 +00:00
2012-05-27 08:53:32 +00:00
2012-05-27 08:53:32 +00:00
2012-05-27 08:53:32 +00:00
2012-05-27 08:53:32 +00:00
2012-05-27 08:53:32 +00:00
2012-09-15 17:56:17 +00:00
2012-09-15 17:56:17 +00:00
2012-08-28 07:50:30 +00:00
2012-03-19 16:48:27 +00:00
2012-09-25 05:08:09 +00:00
2012-08-14 16:36:25 +00:00
2012-09-25 05:08:09 +00:00
2012-08-14 16:36:25 +00:00
2012-05-05 18:02:34 +00:00

Here is some documentation for Nmap, but these files are much less
comprehensive than what you'll find at the actual Nmap documentation
site ( http://nmap.org ).
Languages
C 37.8%
Lua 28.1%
C++ 16.7%
Shell 5.8%
Python 4.2%
Other 7.2%