From c40cbef1f6b0d75ff10589917e7374640041cbd5 Mon Sep 17 00:00:00 2001 From: Guilherme Maciel Ferreira Date: Thu, 9 Jun 2011 16:41:34 -0300 Subject: [PATCH] Added and formatted some error messages --- src/icmp/icmppinger.cpp | 14 +++++++------- 1 files changed, 7 insertions(+), 7 deletions(-) diff --git a/src/icmp/icmppinger.cpp b/src/icmp/icmppinger.cpp index 48ee03c..9a1d575 100644 --- a/src/icmp/icmppinger.cpp +++ b/src/icmp/icmppinger.cpp @@ -159,8 +159,7 @@ void IcmpPinger::send_echo_request( const IcmpPacket &icmp_packet ) size_t bytes_sent = Socket.send_to( data, DestinationEndpoint ); if ( bytes_sent != buffer_size( data ) ) { - GlobalLogger.error() << "Error: fail sending ping data." - << endl; + GlobalLogger.error() << "Error: fail sending ping data." << endl; } } catch ( const exception &ex ) @@ -258,8 +257,7 @@ void IcmpPinger::handle_receive_icmp_packet( const size_t &bytes_transferred ) // ICMP packets from the host we had ping). if ( icmp_packet.match( IcmpType_EchoReply, Identifier, SequenceNumber, - DestinationEndpoint.address()) - ) + DestinationEndpoint.address() ) ) { ReceivedReply = true; @@ -271,8 +269,7 @@ void IcmpPinger::handle_receive_icmp_packet( const size_t &bytes_transferred ) } else if ( icmp_packet.match( IcmpType_DestinationUnreachable, Identifier, SequenceNumber, - DestinationEndpoint.address() - ) ) + DestinationEndpoint.address() ) ) { ReceivedReply = true; @@ -281,7 +278,8 @@ void IcmpPinger::handle_receive_icmp_packet( const size_t &bytes_transferred ) set_ping_status( PingStatus_FailureDestinationUnreachable ); IcmpPacketReceiveTimer.cancel(); - } else + } + else { // Unknown ICMP reply, start another receive till timeout start_receive(); @@ -380,6 +378,8 @@ bool IcmpPinger::select_source_network_interface( ); if ( ret == -1 ) { + GlobalLogger.error() << "Error: could not bind pinger to interface " + << source_network_interface << endl; return false; } -- 1.7.1