diff --git a/CHANGELOG b/CHANGELOG index d84c54718..80396e74a 100644 --- a/CHANGELOG +++ b/CHANGELOG @@ -1,5 +1,10 @@ # Nmap Changelog ($Id$); -*-text-*- +o Changed the name of libdnet's sctp_chunkhdr to avoid a conflict with + a struct of the same name in . This caused a + compiliation error when Nmap was compiled with an OpenSSL that had + SCTP support. [Olli Hauer, Daniel Roethlisberger] + o [NSE] Added the firewalk script, which tries to find whether a firewall blocks or forwards ports like the firewall tool does. [Henri Doreau] diff --git a/libdnet-stripped/NMAP_MODIFICATIONS b/libdnet-stripped/NMAP_MODIFICATIONS index fb4bf1c2e..5fad7bc2c 100644 --- a/libdnet-stripped/NMAP_MODIFICATIONS +++ b/libdnet-stripped/NMAP_MODIFICATIONS @@ -602,6 +602,78 @@ Index: src/addr.c case AF_UNSPEC: case ARP_HRD_ETH: /* XXX- Linux arp(7) */ +o Changed the name of sctp_chunkhdr to dnet_sctp_chunkhdr to avoid a + conflict with a struct of the same name in in FreeBSD + and Linux. + +Index: include/dnet/sctp.h +=================================================================== +--- include/dnet/sctp.h (revision 20087) ++++ include/dnet/sctp.h (working copy) +@@ -36,7 +36,7 @@ + sctp_pack_p->sh_vtag = htonl(vtag); \ + } while (0) + +-struct sctp_chunkhdr { ++struct dnet_sctp_chunkhdr { + uint8_t sch_type; /* chunk type */ + uint8_t sch_flags; /* chunk flags */ + uint16_t sch_length; /* chunk length */ +@@ -70,7 +70,7 @@ + #define SCTP_TYPEFLAG_SKIP 2 + + #define sctp_pack_chunkhdr(hdr, type, flags, length) do { \ +- struct sctp_chunkhdr *sctp_pack_chp = (struct sctp_chunkhdr *)(hdr);\ ++ struct dnet_sctp_chunkhdr *sctp_pack_chp = (struct dnet_sctp_chunkhdr *)(hdr);\ + sctp_pack_chp->sch_type = type; \ + sctp_pack_chp->sch_flags = flags; \ + sctp_pack_chp->sch_length = htons(length); \ +@@ -80,7 +80,7 @@ + * INIT chunk + */ + struct sctp_chunkhdr_init { +- struct sctp_chunkhdr chunkhdr; ++ struct dnet_sctp_chunkhdr chunkhdr; + + uint32_t schi_itag; /* Initiate Tag */ + uint32_t schi_arwnd; /* Advertised Receiver Window Credit */ +@@ -105,7 +105,7 @@ + * INIT ACK chunk + */ + struct sctp_chunkhdr_init_ack { +- struct sctp_chunkhdr chunkhdr; ++ struct dnet_sctp_chunkhdr chunkhdr; + + uint32_t schia_itag; /* Initiate Tag */ + uint32_t schia_arwnd; /* Advertised Receiver Window Credit */ +@@ -130,7 +130,7 @@ + * ABORT chunk + */ + struct sctp_chunkhdr_abort { +- struct sctp_chunkhdr chunkhdr; ++ struct dnet_sctp_chunkhdr chunkhdr; + + /* empty */ + } __attribute__((__packed__)); +@@ -145,7 +145,7 @@ + * SHUTDOWN ACK chunk + */ + struct sctp_chunkhdr_shutdown_ack { +- struct sctp_chunkhdr chunkhdr; ++ struct dnet_sctp_chunkhdr chunkhdr; + + /* empty */ + } __attribute__((__packed__)); +@@ -160,7 +160,7 @@ + * COOKIE ECHO chunk + */ + struct sctp_chunkhdr_cookie_echo { +- struct sctp_chunkhdr chunkhdr; ++ struct dnet_sctp_chunkhdr chunkhdr; + + /* empty */ + } __attribute__((__packed__)); + ===CHANGES ALREADY MERGED TO UPSTREAM LIBDNET GO BELOW THIS LINE=== o Made some code changes to intf.c (the patch below). This does the following: diff --git a/libdnet-stripped/include/dnet/sctp.h b/libdnet-stripped/include/dnet/sctp.h index 1d1f0cbcf..9451abccd 100644 --- a/libdnet-stripped/include/dnet/sctp.h +++ b/libdnet-stripped/include/dnet/sctp.h @@ -36,7 +36,7 @@ struct sctp_hdr { sctp_pack_p->sh_vtag = htonl(vtag); \ } while (0) -struct sctp_chunkhdr { +struct dnet_sctp_chunkhdr { uint8_t sch_type; /* chunk type */ uint8_t sch_flags; /* chunk flags */ uint16_t sch_length; /* chunk length */ @@ -70,7 +70,7 @@ struct sctp_chunkhdr { #define SCTP_TYPEFLAG_SKIP 2 #define sctp_pack_chunkhdr(hdr, type, flags, length) do { \ - struct sctp_chunkhdr *sctp_pack_chp = (struct sctp_chunkhdr *)(hdr);\ + struct dnet_sctp_chunkhdr *sctp_pack_chp = (struct dnet_sctp_chunkhdr *)(hdr);\ sctp_pack_chp->sch_type = type; \ sctp_pack_chp->sch_flags = flags; \ sctp_pack_chp->sch_length = htons(length); \ @@ -80,7 +80,7 @@ struct sctp_chunkhdr { * INIT chunk */ struct sctp_chunkhdr_init { - struct sctp_chunkhdr chunkhdr; + struct dnet_sctp_chunkhdr chunkhdr; uint32_t schi_itag; /* Initiate Tag */ uint32_t schi_arwnd; /* Advertised Receiver Window Credit */ @@ -105,7 +105,7 @@ struct sctp_chunkhdr_init { * INIT ACK chunk */ struct sctp_chunkhdr_init_ack { - struct sctp_chunkhdr chunkhdr; + struct dnet_sctp_chunkhdr chunkhdr; uint32_t schia_itag; /* Initiate Tag */ uint32_t schia_arwnd; /* Advertised Receiver Window Credit */ @@ -130,7 +130,7 @@ struct sctp_chunkhdr_init_ack { * ABORT chunk */ struct sctp_chunkhdr_abort { - struct sctp_chunkhdr chunkhdr; + struct dnet_sctp_chunkhdr chunkhdr; /* empty */ } __attribute__((__packed__)); @@ -145,7 +145,7 @@ struct sctp_chunkhdr_abort { * SHUTDOWN ACK chunk */ struct sctp_chunkhdr_shutdown_ack { - struct sctp_chunkhdr chunkhdr; + struct dnet_sctp_chunkhdr chunkhdr; /* empty */ } __attribute__((__packed__)); @@ -160,7 +160,7 @@ struct sctp_chunkhdr_shutdown_ack { * COOKIE ECHO chunk */ struct sctp_chunkhdr_cookie_echo { - struct sctp_chunkhdr chunkhdr; + struct dnet_sctp_chunkhdr chunkhdr; /* empty */ } __attribute__((__packed__)); diff --git a/scan_engine.cc b/scan_engine.cc index 016c7306a..d4bebf862 100644 --- a/scan_engine.cc +++ b/scan_engine.cc @@ -4148,7 +4148,7 @@ static bool get_pcap_result(UltraScanInfo *USI, struct timeval *stime) { } } else if (ip->ip_p == IPPROTO_SCTP && !USI->prot_scan) { struct sctp_hdr *sctp = (struct sctp_hdr *) ((u8 *) ip + ip->ip_hl * 4); - struct sctp_chunkhdr *chunk = (struct sctp_chunkhdr *) ((u8 *) sctp + 12); + struct dnet_sctp_chunkhdr *chunk = (struct dnet_sctp_chunkhdr *) ((u8 *) sctp + 12); /* Now ensure this host is even in the incomplete list */ memset(&sin, 0, sizeof(sin)); sin.sin_addr.s_addr = ip->ip_src.s_addr; @@ -4761,7 +4761,7 @@ static int get_ping_pcap_result(UltraScanInfo *USI, struct timeval *stime) { } } else if (ip->ip_p == IPPROTO_SCTP && USI->ptech.rawsctpscan) { struct sctp_hdr *sctp = (struct sctp_hdr *) (((char *) ip) + 4 * ip->ip_hl); - struct sctp_chunkhdr *chunk = (struct sctp_chunkhdr *) ((u8 *) sctp + 12); + struct dnet_sctp_chunkhdr *chunk = (struct dnet_sctp_chunkhdr *) ((u8 *) sctp + 12); /* Search for this host on the incomplete list */ memset(&sin, 0, sizeof(sin)); sin.sin_addr.s_addr = ip->ip_src.s_addr;