]> git.ipfire.org Git - thirdparty/snort3.git/commitdiff
loggin tweak. fragment flags print again
authorJosh <jrosenba@cisco.com>
Fri, 31 Oct 2014 22:14:00 +0000 (17:14 -0500)
committerJosh <jrosenba@cisco.com>
Fri, 31 Oct 2014 22:14:00 +0000 (17:14 -0500)
src/log/log_text.cc
src/protocols/ipv4.h

index 508fb47f7ee0a4ca0aa942123fa2d853a62e4068..053ec766e12aad2479f71e699c78a8840c9d61ed 100644 (file)
@@ -647,7 +647,6 @@ void LogIPHeader(TextLog*  log, Packet * p)
         }
         else
         {
-
             if(ip6_frag->rb())
                 TextLog_Puts(log, " RB");
 
@@ -667,23 +666,16 @@ void LogIPHeader(TextLog*  log, Packet * p)
                 ip4h->hlen(),
                 ip4h->len());
 
-        frag_off = ip4h->off();
-
-        if (frag_off)
-        {
-          /* print the reserved bit if it's set */
-          if(ip4h->rb())
-              TextLog_Puts(log, " RB");
+        if(ip4h->rb())
+            TextLog_Puts(log, " RB");
 
-          /* printf more frags/don't frag bits */
-          if(ip4h->df())
-              TextLog_Puts(log, " DF");
+        if(ip4h->df())
+            TextLog_Puts(log, " DF");
 
-          if(ip4h->mf())
-              TextLog_Puts(log, " MF");
+        if(ip4h->mf())
+            TextLog_Puts(log, " MF");
 
-          frag_off = (frag_off & 0x1FFF);
-        }
+        frag_off = ip4h->off();
     }
 
     TextLog_NewLine(log);
index ddf0da105624f5290b581d7f44ed352f0f21ab60..d7162ae462eed22f3e97ea5e1e1d26a30bf4bd20 100644 (file)
@@ -98,12 +98,12 @@ struct IP4Hdr
     inline uint16_t rb() const
     { return ntohs(ip_off) & 0x8000; }
 
-    inline uint16_t mf() const
-    { return ntohs(ip_off) & 0x2000; }
-
     inline uint16_t df() const
     { return ntohs(ip_off) & 0x4000; }
 
+    inline uint16_t mf() const
+    { return ntohs(ip_off) & 0x2000; }
+
     inline uint16_t off() const
     { return (ntohs(ip_off) & 0x1FFF) << 3; }