FreeBSD/sys/net/if_llatbl.c
/*
 * Deletes an address from given lltable.
 * Used for userland interaction to remove
 * individual entries. Skips entries added by OS.
 */
Deletes an address from given lltable.
Used for userland interaction to remove
individual entries. Skips entries added by OS.
Deletes an address from given lltable . Used for userland interaction to remove individual entries . Skips entries added by OS .
int
lltable_delete_addr(struct lltable *llt, u_int flags,
    const struct sockaddr *l3addr)
{
	struct llentry *lle;
	struct ifnet *ifp;
	ifp = llt->llt_ifp;
	IF_AFDATA_WLOCK(ifp);
	lle = lla_lookup(llt, LLE_EXCLUSIVE, l3addr);
	if (lle == NULL) {
		IF_AFDATA_WUNLOCK(ifp);
		return (ENOENT);
	}
	if ((lle->la_flags & LLE_IFADDR) != 0 && (flags & LLE_IFADDR) == 0) {
		IF_AFDATA_WUNLOCK(ifp);
		LLE_WUNLOCK(lle);
		return (EPERM);
	}
	lltable_unlink_entry(llt, lle);
	IF_AFDATA_WUNLOCK(ifp);
	llt->llt_delete_entry(llt, lle);
	return (0);
}
int lltable_delete_addr ( struct lltable * llt , u_int flags , const struct sockaddr * l3addr ) { struct llentry * lle ; struct ifnet * ifp ; ifp = llt -> llt_ifp ; IF_AFDATA_WLOCK ( ifp ) ; lle = lla_lookup ( llt , LLE_EXCLUSIVE , l3addr ) ; if ( lle == NULL ) { IF_AFDATA_WUNLOCK ( ifp ) ; return ( ENOENT ) ; } if ( ( lle -> la_flags & LLE_IFADDR ) != 0 && ( flags & LLE_IFADDR ) == 0 ) { IF_AFDATA_WUNLOCK ( ifp ) ; LLE_WUNLOCK ( lle ) ; return ( EPERM ) ; } lltable_unlink_entry ( llt , lle ) ; IF_AFDATA_WUNLOCK ( ifp ) ; llt -> llt_delete_entry ( llt , lle ) ; return ( 0 ) ; }
Deletes an address from given lltable.
Deletes an address from given lltable .