/* eth_header_cache - fill cache entry from neighbour @neigh: source neighbour @hh: destination cache entry Create an Ethernet header template from the neighbour.  */
int eth_header_cache(const struct neighbour *neigh, struct hh_cache *hh)
/* eth_header_cache - fill cache entry from neighbour @neigh: source neighbour @hh: destination cache entry Create an Ethernet header template from the neighbour.  */
int eth_header_cache(const struct neighbour *neigh, struct hh_cache *hh)
{
	__be16 type = hh->hh_type;
	struct ethhdr *eth;
	const struct net_device *dev = neigh->dev;
	eth = (struct ethhdr *)
	    (((u8 *) hh->hh_data) + (HH_DATA_OFF(sizeof(*eth))));
	if (type == htons(ETH_P_802_3))
		return -1;
	eth->h_proto = type;
	memcpy(eth->h_source, dev->dev_addr, ETH_ALEN);
	memcpy(eth->h_dest, neigh->ha, ETH_ALEN);
	hh->hh_len = ETH_HLEN;
	return 0;
}