patch-2.4.22 linux-2.4.22/net/ethernet/eth.c

Next file: linux-2.4.22/net/ipv4/Config.in
Previous file: linux-2.4.22/net/decnet/dn_table.c
Back to the patch index
Back to the overall index

diff -urN linux-2.4.21/net/ethernet/eth.c linux-2.4.22/net/ethernet/eth.c
@@ -216,9 +216,12 @@
 int eth_header_cache(struct neighbour *neigh, struct hh_cache *hh)
 {
 	unsigned short type = hh->hh_type;
-	struct ethhdr *eth = (struct ethhdr*)(((u8*)hh->hh_data) + 2);
+	struct ethhdr *eth;
 	struct net_device *dev = neigh->dev;
 
+	eth = (struct ethhdr*)
+		(((u8*)hh->hh_data) + (HH_DATA_OFF(sizeof(*eth))));
+
 	if (type == __constant_htons(ETH_P_802_3))
 		return -1;
 
@@ -235,5 +238,6 @@
 
 void eth_header_cache_update(struct hh_cache *hh, struct net_device *dev, unsigned char * haddr)
 {
-	memcpy(((u8*)hh->hh_data) + 2, haddr, dev->addr_len);
+	memcpy(((u8*)hh->hh_data) + HH_DATA_OFF(sizeof(struct ethhdr)),
+	       haddr, dev->addr_len);
 }

FUNET's LINUX-ADM group, linux-adm@nic.funet.fi
TCL-scripts by Sam Shen (who was at: slshen@lbl.gov)