[Snort-devel] BUG - Solaris + snort 2.0.1 in PrintTcpOptions

Bruno Saverio Delbono bdelbono at ...2087...
Wed Jul 23 17:56:26 EDT 2003


Moin snort-devel! 
 Bruno Saverio Delbono schrieb am Mittwoch, den 23. Juli 2003:

>Workaround: Currently none

See attached patch which fixes this problems of snort core dumping for me.
Perhaps:

- This might be solely related to SunPRO Compilers
- This patch "may" cause some archs to break. I don't think it should,
  however you've been warned. (I've tested it to work on Linux and OpenBSD
  x86) with no problems.

-- 
Bruno Saverio Delbono <bdelbono at leviathan dot lucifer dot at>
Systems Engineer - Open-Systems Group Inc.
http://www.open-systems.org/users/bruno/
GPG Fingerprint: 1AAC 0F81 54F6 C7AF 2EC4  8993 0594 88B3 E127 35C5
-------------- next part --------------
gdiff -u ../../snort-2.0.1/src/log.c log.c
--- ../../snort-2.0.1/src/log.c Wed Apr  9 14:12:24 2003
+++ log.c       Wed Jul 23 17:45:58 2003
@@ -1544,7 +1544,7 @@
                 bzero((char *) tmp, 5);
                 fwrite("MSS: ", 5, 1, fp);
                 memcpy(tmp, p->tcp_options[i].data, 2);
-                fprintf(fp, "%u ", EXTRACT_16BITS(tmp));
+                fprintf(fp, "%u ", EXTRACT_32BITS(tmp));
                 break;
 
             case TCPOPT_EOL:
@@ -1562,10 +1562,10 @@
             case TCPOPT_SACK:
                 bzero((char *) tmp, 5);
                 memcpy(tmp, p->tcp_options[i].data, 2);
-                fprintf(fp, "Sack: %u@", EXTRACT_16BITS(tmp));
+                fprintf(fp, "Sack: %u@", EXTRACT_32BITS(tmp));
                 bzero((char *) tmp, 5);
                 memcpy(tmp, (p->tcp_options[i].data) + 2, 2);
-                fprintf(fp, "%u ", EXTRACT_16BITS(tmp));
+                fprintf(fp, "%u ", EXTRACT_32BITS(tmp));
                 break;
 
             case TCPOPT_SACKOK:


More information about the Snort-devel mailing list