fixed bug in ICMP Packet Factory: do not continue with garbage packet if read from...
authorChristian Herdtweck <christian.herdtweck@intra2net.com>
Wed, 5 Nov 2014 15:11:14 +0000 (16:11 +0100)
committerChristian Herdtweck <christian.herdtweck@intra2net.com>
Wed, 12 Nov 2014 10:10:45 +0000 (11:10 +0100)
removed commented lines that do same as shared_ptr.reset which was added in previous commit

src/icmp/icmppacketfactory.cpp

index 88c7330..3488f02 100644 (file)
@@ -72,11 +72,11 @@ IcmpPacketItem IcmpPacketFactory::create_icmp_packet(
 
     if ( !icmp_packet->read( is ) )
     {
-        GlobalLogger.notice() << "Could not read ICMP packet." << endl;
+        GlobalLogger.warning() << "ICMP packet creation failed" << endl;
+        icmp_packet.reset();    // --> (!icmp_packet) is true
+           // --> icmp_pinger will not try to continue working with this packet
 
         // TODO why good packets are reports as bad? The read() has problems!
-        //IcmpPacketItem icmp_packet_empty;
-        //icmp_packet = icmp_packet_empty;
     }
 
     return icmp_packet;