FreeBSD/sys/net/if_llatbl.c
/*
 * Update link-layer header for given @lle after
 * interface lladdr was changed.
 */
Update link-layer header for given @lle after
interface lladdr was changed.
Update link - layer header for given @lle after interface lladdr was changed .
static int
llentry_update_ifaddr(struct lltable *llt, struct llentry *lle, void *farg)
{
	struct ifnet *ifp;
	u_char linkhdr[LLE_MAX_LINKHDR];
	size_t linkhdrsize;
	u_char *lladdr;
	int lladdr_off;
	ifp = (struct ifnet *)farg;
	lladdr = lle->ll_addr;
	LLE_WLOCK(lle);
	if ((lle->la_flags & LLE_VALID) == 0) {
		LLE_WUNLOCK(lle);
		return (0);
	}
	if ((lle->la_flags & LLE_IFADDR) != 0)
		lladdr = IF_LLADDR(ifp);
	linkhdrsize = sizeof(linkhdr);
	lltable_calc_llheader(ifp, llt->llt_af, lladdr, linkhdr, &linkhdrsize,
	    &lladdr_off);
	memcpy(lle->r_linkdata, linkhdr, linkhdrsize);
	LLE_WUNLOCK(lle);
	return (0);
}
static int llentry_update_ifaddr ( struct lltable * llt , struct llentry * lle , void * farg ) { struct ifnet * ifp ; u_char linkhdr [ LLE_MAX_LINKHDR ] ; size_t linkhdrsize ; u_char * lladdr ; int lladdr_off ; ifp = ( struct ifnet * ) farg ; lladdr = lle -> ll_addr ; LLE_WLOCK ( lle ) ; if ( ( lle -> la_flags & LLE_VALID ) == 0 ) { LLE_WUNLOCK ( lle ) ; return ( 0 ) ; } if ( ( lle -> la_flags & LLE_IFADDR ) != 0 ) lladdr = IF_LLADDR ( ifp ) ; linkhdrsize = sizeof ( linkhdr ) ; lltable_calc_llheader ( ifp , llt -> llt_af , lladdr , linkhdr , & linkhdrsize , & lladdr_off ) ; memcpy ( lle -> r_linkdata , linkhdr , linkhdrsize ) ; LLE_WUNLOCK ( lle ) ; return ( 0 ) ; }
Update link-layer header for given @lle after
 interface lladdr was changed.
Update link - layer header for given @lle after interface lladdr was changed .