]> git.ipfire.org Git - thirdparty/snort3.git/commitdiff
getting rid of arp_spoof - type-punned pointer error
authorJosh <jrosenba@cisco.com>
Wed, 27 Aug 2014 19:10:35 +0000 (15:10 -0400)
committerJosh <jrosenba@cisco.com>
Wed, 27 Aug 2014 19:10:35 +0000 (15:10 -0400)
src/loggers/CMakeLists.txt
src/main/snort.h
src/network_inspectors/arp_spoof/arp_spoof.cc
src/protocols/arp.h
src/test/sfrt_test.cc

index 2ed0d780b943a12f5583d6790511f37daa60f811..104e6f82e51c35625f0eb9347d3624fffaf59f4f 100644 (file)
@@ -1,13 +1,13 @@
 
 include_directories(${LUAJIT_INCLUDE_DIR})
 
-set ( LOGGER_SOURCES
+set (LOGGER_SOURCES
     alert_luajit.cc
     loggers.cc
     loggers.h
 )
 
-set ( PLUGIN_LIST
+set (PLUGIN_LIST
     alert_csv.cc
     alert_fast.cc
     alert_full.cc
@@ -20,7 +20,7 @@ set ( PLUGIN_LIST
     unified2_common.h
 )
 
-if( LINUX )
+if (LINUX)
     set ( PLUGIN_LIST
         ${PLUGIN_LIST}
         alert_sf_socket.cc
index e7270ef8b4869d2441dd41de9d2f4a9682b01df6..f3d5d84097c6d19cf5a0500139bd1e83bfb612e4 100644 (file)
@@ -37,7 +37,7 @@
 
 
 struct Packet;
-struct Flow;
+class Flow;
 struct NetworkPolicy;
 struct InspectionPolicy;
 struct IpsPolicy;
index 636e5793114f92f411cc71d435478370f880a3ed..ef38581d825e5d798050486c52655c8f005e6550 100644 (file)
@@ -245,7 +245,7 @@ void ArpSpoof::eval(Packet *p)
         return;
 
     if ((ipme = LookupIPMacEntryByIP(config->ipmel,
-                                     *(uint32_t *)&ah->arp_spa)) == NULL)
+                                     ah->arp_spa32)) == NULL)
     {
         DEBUG_WRAP(DebugMessage(DEBUG_PLUGIN,
                 "MODNAME: LookupIPMacEntryByIp returned NULL\n"););
index 6775ee4103c61f6e9191c51e18ae647a7188c9c3..190db2d3071709a85ffc2c2a1aa981ceb5ac28bf 100644 (file)
@@ -44,7 +44,11 @@ struct EtherARP
 {
     ARPHdr ea_hdr;      /* fixed-size header */
     uint8_t arp_sha[6];    /* sender hardware address */
-    uint8_t arp_spa[4];    /* sender protocol address */
+    union
+    {
+        uint8_t arp_spa[4];    /* sender protocol address */
+        uint32_t arp_spa32;
+    };
     uint8_t arp_tha[6];    /* target hardware address */
     uint8_t arp_tpa[4];    /* target protocol address */
 };
index 093a74d3c2c52a001c143421c29a48dfc03067f8..77dd5533d73c5efe8209c2e897468185507055ee 100644 (file)
@@ -27,6 +27,7 @@
 
 #include "snort_types.h"
 #include "sfrt/sfrt.h"
+#include "sfip/sf_ip.h"
 
 #define NUM_IPS 32
 #define NUM_DATA 4