From: Michael Brown Date: Fri, 9 Jan 2026 18:29:53 +0000 (+0000) Subject: [neighbour] Treat delayed transmissions as pending operations X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=refs%2Fheads%2Fcoverity_scan;p=thirdparty%2Fipxe.git [neighbour] Treat delayed transmissions as pending operations Treat each delayed transmission as a pending operation, so that the "sync" command can be used to ensure that all delayed packets have been transmitted. Signed-off-by: Michael Brown --- diff --git a/src/net/neighbour.c b/src/net/neighbour.c index 9d926a485..ac79041e3 100644 --- a/src/net/neighbour.c +++ b/src/net/neighbour.c @@ -31,6 +31,7 @@ FILE_LICENCE ( GPL2_OR_LATER_OR_UBDL ); #include #include #include +#include #include #include @@ -64,6 +65,9 @@ FILE_LICENCE ( GPL2_OR_LATER_OR_UBDL ); /** 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 ); /** @@ -226,6 +230,9 @@ static void neighbour_tx_queue ( struct neighbour *neighbour ) { /* Strip pseudo-header */ iob_pull ( iobuf, sizeof ( *delay ) ); + + /* Remove pending operation */ + pending_put ( &neighbour_delayed ); } /* Transmit deferred packet */ @@ -296,6 +303,8 @@ static void neighbour_destroy ( struct neighbour *neighbour, int rc ) { 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 ); } @@ -399,6 +408,9 @@ int neighbour_tx ( struct io_buffer *iobuf, struct net_device *netdev, 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 );