/* Update an L2T entry that was previously used for the same next hop as neigh. Must be called with softirqs disabled.  */
static void reuse_entry(struct l2t_entry *e, struct neighbour *neigh)
/* Update an L2T entry that was previously used for the same next hop as neigh. Must be called with softirqs disabled.  */
static void reuse_entry(struct l2t_entry *e, struct neighbour *neigh)
{
	unsigned int nud_state;
	spin_lock(&e->lock);
	if (neigh != e->neigh)
		neigh_replace(e, neigh);
	nud_state = neigh->nud_state;
	if (memcmp(e->dmac, neigh->ha, sizeof(e->dmac)) ||
	    !(nud_state & NUD_VALID))
		e->state = L2T_STATE_RESOLVING;
	else if (nud_state & NUD_CONNECTED)
		e->state = L2T_STATE_VALID;
	else
		e->state = L2T_STATE_STALE;
	spin_unlock(&e->lock);
}