1
0
mirror of https://github.com/nmap/nmap.git synced 2026-01-23 06:39:01 +00:00

o Changed the name of libdnet's sctp_chunkhdr to avoid a conflict with

a struct of the same name in <netinet/sctp.h>. This caused a
  compiliation error when Nmap was compiled with an OpenSSL that had
  SCTP support. [Olli Hauer, Daniel Roethlisberger]
This commit is contained in:
david
2010-09-05 03:40:31 +00:00
parent 47bc61d69d
commit a2b84bf74f
4 changed files with 86 additions and 9 deletions

View File

@@ -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 <netinet/sctp.h>. 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]

View File

@@ -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 <netinet/sctp.h> 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:

View File

@@ -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__));

View File

@@ -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;