mirror of
https://github.com/nmap/nmap.git
synced 2025-12-25 17:09:02 +00:00
Fix bugs in protocol file parsing
Protocol numbers were being used as a short in network byte order instead of host byte order, so this command would fail: nmap -sO -p tcp Additionally, duplicate protocols would not be reported correctly. This change speeds up lookups and simplifies the code.
This commit is contained in:
@@ -75,18 +75,11 @@
|
||||
#include "libnetutil/netutil.h"
|
||||
#endif
|
||||
|
||||
#define PROTOCOL_TABLE_SIZE 256
|
||||
|
||||
struct nprotoent {
|
||||
const char *p_name;
|
||||
short p_proto;
|
||||
};
|
||||
|
||||
struct protocol_list {
|
||||
struct nprotoent *protoent;
|
||||
struct protocol_list *next;
|
||||
};
|
||||
|
||||
int addprotocolsfromservmask(char *mask, u8 *porttbl);
|
||||
struct nprotoent *nmap_getprotbynum(int num);
|
||||
|
||||
|
||||
Reference in New Issue
Block a user