]> git.ipfire.org Git - thirdparty/snort3.git/commitdiff
Merge pull request #136 in SNORT/snort3 from arpfix to master
authorRuss Combs (rucombs) <rucombs@cisco.com>
Tue, 17 Nov 2015 10:38:43 +0000 (05:38 -0500)
committerRuss Combs (rucombs) <rucombs@cisco.com>
Tue, 17 Nov 2015 10:38:43 +0000 (05:38 -0500)
Squashed commit of the following:

commit da42c8bafa4a46be209557e3f4654ecb6cf5bee9
Author: Steve Chew <stechew@cisco.com>
Date:   Mon Nov 16 18:04:19 2015 -0500

    Fix arp inspection bug

src/managers/inspector_manager.cc
src/protocols/arp.h

index 1c36224640d92609a40ad653eb66ef1d2d9de5ab..8d72607cef84aeaee06da059a268a7a401da0844 100644 (file)
@@ -793,7 +793,10 @@ void InspectorManager::execute(Packet* p)
 
     Flow* flow = p->flow;
 
-    if ( flow && flow->full_inspection() )
+    if ( !flow )
+        ::execute(p, fp->network.vec, fp->network.num);
+
+    else if ( flow->full_inspection() )
         full_inspection(fp, p);
 
     ::execute(p, fp->probe.vec, fp->probe.num);
index 533eb759b7d43ae92f9e19868f53241cd4984510..a18f2b61fdd21de27fe35ad804766e5c0a4a87a8 100644 (file)
@@ -22,6 +22,7 @@
 
 namespace arp
 {
+
 struct ARPHdr
 {
     uint16_t ar_hrd;       /* format of hardware address   */
@@ -42,9 +43,10 @@ struct EtherARP
     };
     uint8_t arp_tha[6];    /* target hardware address */
     uint8_t arp_tpa[4];    /* target protocol address */
-};
+} __attribute__((__packed__));
 
 constexpr uint16_t ETHERARP_HDR_LEN = 28; /*  sizeof EtherARP != 28 */
+
 } // namespace arp
 
 #ifndef ARPOP_REQUEST