[ping] Report timed-out pings via the callback function

Signed-off-by: Michael Brown <mcb30@ipxe.org>
This commit is contained in:
Michael Brown
2014-10-23 15:04:10 +01:00
parent af17abf67f
commit d1afe731ea
2 changed files with 14 additions and 3 deletions

View File

@@ -36,7 +36,7 @@ FILE_LICENCE ( GPL2_OR_LATER );
/**
* Display ping result
*
* @v src Source socket address
* @v src Source socket address, or NULL
* @v sequence Sequence number
* @v len Payload length
* @v rc Status code
@@ -46,7 +46,7 @@ static void ping_callback ( struct sockaddr *peer, unsigned int sequence,
/* Display ping response */
printf ( "%zd bytes from %s: seq=%d",
len, sock_ntoa ( peer ), sequence );
len, ( peer ? sock_ntoa ( peer ) : "<none>" ), sequence );
if ( rc != 0 )
printf ( ": %s", strerror ( rc ) );
printf ( "\n" );