File tree Expand file tree Collapse file tree 2 files changed +3
-3
lines changed
Expand file tree Collapse file tree 2 files changed +3
-3
lines changed Original file line number Diff line number Diff line change @@ -67,7 +67,7 @@ int ICMPPlugin::post_create(Flow &rec, const Packet &pkt)
6767{
6868 if (pkt.ip_proto == IPPROTO_ICMP ||
6969 pkt.ip_proto == IPPROTO_ICMPV6) {
70- if (pkt.payload_len < 2 )
70+ if (pkt.payload_len < sizeof (RecordExtICMP::type_code) )
7171 return 0 ;
7272
7373 auto ext = new RecordExtICMP ();
Original file line number Diff line number Diff line change @@ -120,8 +120,8 @@ struct RecordExtICMP : public RecordExt {
120120 auto *type_code = reinterpret_cast <const uint8_t *>(&this ->type_code );
121121
122122 std::ostringstream out;
123- out << " type=\" " << ( int ) type_code[0 ] << ' "'
124- << " ,code=\" " << ( int ) type_code[1 ] << ' "' ;
123+ out << " type=\" " << static_cast < int >( type_code[0 ]) << ' "'
124+ << " ,code=\" " << static_cast < int >( type_code[1 ]) << ' "' ;
125125
126126 return out.str ();
127127 }
You can’t perform that action at this time.
0 commit comments