FreeBSD/sys/netinet/in.c
/*
 * Return NULL if not found or marked for deletion.
 * If found return lle read locked.
 */
Return NULL if not found or marked for deletion.
If found return lle read locked.
Return NULL if not found or marked for deletion . If found return lle read locked .
static struct llentry *
in_lltable_lookup(struct lltable *llt, u_int flags, const struct sockaddr *l3addr)
{
	const struct sockaddr_in *sin = (const struct sockaddr_in *)l3addr;
	struct llentry *lle;
	IF_AFDATA_LOCK_ASSERT(llt->llt_ifp);
	KASSERT(l3addr->sa_family == AF_INET,
	    ("sin_family %d", l3addr->sa_family));
	lle = in_lltable_find_dst(llt, sin->sin_addr);
	if (lle == NULL)
		return (NULL);
	KASSERT((flags & (LLE_UNLOCKED|LLE_EXCLUSIVE)) !=
	    (LLE_UNLOCKED|LLE_EXCLUSIVE),("wrong lle request flags: 0x%X",
	    flags));
	if (flags & LLE_UNLOCKED)
		return (lle);
	if (flags & LLE_EXCLUSIVE)
		LLE_WLOCK(lle);
	else
		LLE_RLOCK(lle);
	return (lle);
}
static struct llentry * in_lltable_lookup ( struct lltable * llt , u_int flags , const struct sockaddr * l3addr ) { const struct sockaddr_in * sin = ( const struct sockaddr_in * ) l3addr ; struct llentry * lle ; IF_AFDATA_LOCK_ASSERT ( llt -> llt_ifp ) ; KASSERT ( l3addr -> sa_family == AF_INET , ( " " , l3addr -> sa_family ) ) ; lle = in_lltable_find_dst ( llt , sin -> sin_addr ) ; if ( lle == NULL ) return ( NULL ) ; KASSERT ( ( flags & ( LLE_UNLOCKED | LLE_EXCLUSIVE ) ) != ( LLE_UNLOCKED | LLE_EXCLUSIVE ) , ( " " , flags ) ) ; if ( flags & LLE_UNLOCKED ) return ( lle ) ; if ( flags & LLE_EXCLUSIVE ) LLE_WLOCK ( lle ) ; else LLE_RLOCK ( lle ) ; return ( lle ) ; }
Return NULL if not found or marked for deletion.
Return NULL if not found or marked for deletion .