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 )
// ICMP packets from the host we had ping).
if ( icmp_packet.match(
IcmpType_EchoReply, Identifier, SequenceNumber,
- DestinationEndpoint.address())
- )
+ DestinationEndpoint.address() ) )
{
ReceivedReply = true;
}
else if ( icmp_packet.match(
IcmpType_DestinationUnreachable, Identifier, SequenceNumber,
- DestinationEndpoint.address()
- ) )
+ DestinationEndpoint.address() ) )
{
ReceivedReply = true;
set_ping_status( PingStatus_FailureDestinationUnreachable );
IcmpPacketReceiveTimer.cancel();
- } else
+ }
+ else
{
// Unknown ICMP reply, start another receive till timeout
start_receive();
);
if ( ret == -1 )
{
+ GlobalLogger.error() << "Error: could not bind pinger to interface "
+ << source_network_interface << endl;
return false;
}