#include <ipxe/retry.h>
#include <ipxe/timer.h>
#include <ipxe/malloc.h>
+#include <ipxe/pending.h>
#include <ipxe/neighbour.h>
#include <config/fault.h>
/** The neighbour cache */
struct list_head neighbours = LIST_HEAD_INIT ( neighbours );
+/** Pending operation for delayed transmissions */
+static struct pending_operation neighbour_delayed;
+
static void neighbour_expired ( struct retry_timer *timer, int over );
/**
/* Strip pseudo-header */
iob_pull ( iobuf, sizeof ( *delay ) );
+
+ /* Remove pending operation */
+ pending_put ( &neighbour_delayed );
}
/* Transmit deferred packet */
net_protocol->ntoa ( neighbour->net_dest ),
strerror ( rc ) );
list_del ( &iobuf->list );
+ if ( NEIGHBOUR_DELAY_MS )
+ pending_put ( &neighbour_delayed );
netdev_tx_err ( neighbour->netdev, iobuf, rc );
}
delay = iob_push ( iobuf, sizeof ( *delay ) );
delay->start = currticks();
+ /* Add pending operation */
+ pending_get ( &neighbour_delayed );
+
/* Process deferred packet queue, if possible */
if ( ! neighbour->discovery )
neighbour_tx_queue ( neighbour );