Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Enum RECORD_CLASS in nmap_dns.h collides with WinDef.h #219

Closed
nnposter opened this issue Oct 3, 2015 · 1 comment
Closed

Enum RECORD_CLASS in nmap_dns.h collides with WinDef.h #219

nnposter opened this issue Oct 3, 2015 · 1 comment

Comments

@nnposter
Copy link

nnposter commented Oct 3, 2015

nmap_dns.h contains:

typedef enum {
  IN = 1
} RECORD_CLASS;

which causes a name collision with WinDef.h, sourced earlier:

#ifndef IN
#define IN
#endif

Renaming the enum member addresses the issue. Patch against r35293 follows:

--- nmap_dns.h.orig 2015-10-02 07:17:50.000000000 -0600
+++ nmap_dns.h  2015-10-03 17:44:29.008431800 -0600
@@ -189,7 +189,7 @@
 } RECORD_TYPE;

 typedef enum {
-  IN = 1
+  CLASS_IN = 1
 } RECORD_CLASS;

 const u8 COMPRESSED_NAME = 0xc0;
--- nmap_dns.cc.orig    2015-10-02 07:17:52.000000000 -0600
+++ nmap_dns.cc 2015-10-03 17:44:51.135697400 -0600
@@ -749,7 +749,7 @@
       it != p.answers.end(); ++it )
   {
     const DNS::Answer &a = *it;
-    if(a.record_class == DNS::IN)
+    if(a.record_class == DNS::CLASS_IN)
     {
       switch(a.record_type)
       {
@@ -1416,7 +1416,7 @@
   DNS_CHECK_ACCUMLATE(ret, tmp, putUnsignedShort(0, buf, ARCOUNT, maxlen));
   DNS_CHECK_ACCUMLATE(ret, tmp, putDomainName(name, buf, DATA, maxlen));
   DNS_CHECK_ACCUMLATE(ret, tmp, putUnsignedShort(rt, buf, ret, maxlen));
-  DNS_CHECK_ACCUMLATE(ret, tmp, putUnsignedShort(IN, buf, ret, maxlen));
+  DNS_CHECK_ACCUMLATE(ret, tmp, putUnsignedShort(CLASS_IN, buf, ret, maxlen));

   return ret;
 }
@dmiller-nmap
Copy link

Good catch, and I like the name CLASS_IN better anyway.

qha pushed a commit to qha/nmap that referenced this issue Dec 16, 2015
qha pushed a commit to qha/nmap that referenced this issue Dec 16, 2015
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants