[neighbour] Use discovery protocol field to identify incomplete neighbours

Use the discovery protocol pointer field (rather than the running
state of the discovery timer) to determine whether or not neighbour
discovery is ongoing, as a precursor to allowing the timer to be
(ab)used for adding deliberate latency to transmitted packets.

Signed-off-by: Michael Brown <mcb30@ipxe.org>
This commit is contained in:
Michael Brown
2026-01-05 15:46:52 +00:00
parent d0e01bb3fc
commit aabfb8a94d
3 changed files with 19 additions and 22 deletions

View File

@@ -49,9 +49,9 @@ struct neighbour {
/** Link-layer destination address */
uint8_t ll_dest[MAX_LL_ADDR_LEN];
/** Neighbour discovery protocol (if any) */
/** Neighbour discovery protocol (if discovery is ongoing) */
struct neighbour_discovery *discovery;
/** Network-layer source address (if any) */
/** Network-layer source address (for discovery requests) */
uint8_t net_source[MAX_NET_ADDR_LEN];
/** Retransmission timer */
struct retry_timer timer;
@@ -60,17 +60,6 @@ struct neighbour {
struct list_head tx_queue;
};
/**
* Test if neighbour cache entry has a valid link-layer address
*
* @v neighbour Neighbour cache entry
* @ret has_ll_dest Neighbour cache entry has a valid link-layer address
*/
static inline __attribute__ (( always_inline )) int
neighbour_has_ll_dest ( struct neighbour *neighbour ) {
return ( ! timer_running ( &neighbour->timer ) );
}
extern struct list_head neighbours;
extern int neighbour_tx ( struct io_buffer *iobuf, struct net_device *netdev,