patch-2.4.0-test7 linux/net/ethernet/eth.c

Next file: linux/net/ipv4/Config.in
Previous file: linux/net/core/sock.c
Back to the patch index
Back to the overall index

diff -u --recursive --new-file v2.4.0-test6/linux/net/ethernet/eth.c linux/net/ethernet/eth.c
@@ -258,43 +258,3 @@
 {
 	memcpy(((u8*)hh->hh_data) + 2, haddr, dev->addr_len);
 }
-
-#if 0 /*ndef CONFIG_IP_ROUTER*/
-/* This one is only slowdown with checksumming in user process context. --ANK */
-
-/*
- *	Copy from an ethernet device memory space to an sk_buff while checksumming if IP
- */
- 
-void eth_copy_and_sum(struct sk_buff *dest, unsigned char *src, int length, int base)
-{
-	struct ethhdr *eth;
-	struct iphdr *iph;
-	int ip_length;
-
-	eth=(struct ethhdr *)src;
-	if(eth->h_proto!=htons(ETH_P_IP))
-	{
-		memcpy(dest->data,src,length);
-		return;
-	}
-	/*
-	 * We have to watch for padded packets. The csum doesn't include the
-	 * padding, and there is no point in copying the padding anyway.
-	 * We have to use the smaller of length and ip_length because it
-	 * can happen that ip_length > length.
-	 */
-	memcpy(dest->data,src,sizeof(struct iphdr)+ETH_HLEN);	/* ethernet is always >= 34 */
-	length -= sizeof(struct iphdr) + ETH_HLEN;
-	iph=(struct iphdr*)(src+ETH_HLEN);
-	ip_length = ntohs(iph->tot_len) - sizeof(struct iphdr);
-
-	/* Also watch out for bogons - min IP size is 8 (rfc-1042) */
-	if ((ip_length <= length) && (ip_length > 7))
-		length=ip_length;
-
-	dest->csum=csum_partial_copy_nocheck(src+sizeof(struct iphdr)+ETH_HLEN,dest->data+sizeof(struct iphdr)+ETH_HLEN,length,base);
-	dest->ip_summed=1;
-}
-
-#endif /* !(CONFIG_IP_ROUTER) */

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