From: Josh Date: Fri, 31 Oct 2014 22:14:00 +0000 (-0500) Subject: loggin tweak. fragment flags print again X-Git-Tag: 3.0.0-233~1286 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=fc8d871008687abc3028e41bec57c7d02834b987;p=thirdparty%2Fsnort3.git loggin tweak. fragment flags print again --- diff --git a/src/log/log_text.cc b/src/log/log_text.cc index 508fb47f7..053ec766e 100644 --- a/src/log/log_text.cc +++ b/src/log/log_text.cc @@ -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); diff --git a/src/protocols/ipv4.h b/src/protocols/ipv4.h index ddf0da105..d7162ae46 100644 --- a/src/protocols/ipv4.h +++ b/src/protocols/ipv4.h @@ -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; }