|
|
@@ -166,7 +166,7 @@ static void pinger_expired ( struct retry_timer *timer, int over __unused ) {
|
|
166
|
166
|
int rc;
|
|
167
|
167
|
|
|
168
|
168
|
/* If no response has been received, notify the callback function */
|
|
169
|
|
- if ( pinger->pending )
|
|
|
169
|
+ if ( pinger->pending && pinger->callback )
|
|
170
|
170
|
pinger->callback ( NULL, pinger->sequence, 0, -ETIMEDOUT );
|
|
171
|
171
|
|
|
172
|
172
|
/* Check for termination */
|
|
|
@@ -263,8 +263,9 @@ static int pinger_deliver ( struct pinger *pinger, struct io_buffer *iobuf,
|
|
263
|
263
|
/* Discard I/O buffer */
|
|
264
|
264
|
free_iob ( iobuf );
|
|
265
|
265
|
|
|
266
|
|
- /* Notify callback function */
|
|
267
|
|
- pinger->callback ( meta->src, sequence, len, rc );
|
|
|
266
|
+ /* Notify callback function, if applicable */
|
|
|
267
|
+ if ( pinger->callback )
|
|
|
268
|
+ pinger->callback ( meta->src, sequence, len, rc );
|
|
268
|
269
|
|
|
269
|
270
|
/* Terminate if applicable */
|
|
270
|
271
|
if ( terminate )
|
|
|
@@ -301,6 +302,7 @@ static struct interface_descriptor pinger_job_desc =
|
|
301
|
302
|
* @v timeout Timeout (in ticks)
|
|
302
|
303
|
* @v len Payload length
|
|
303
|
304
|
* @v count Number of packets to send (or zero for no limit)
|
|
|
305
|
+ * @v callback Callback function (or NULL)
|
|
304
|
306
|
* @ret rc Return status code
|
|
305
|
307
|
*/
|
|
306
|
308
|
int create_pinger ( struct interface *job, const char *hostname,
|