patch-1.3.6 linux/net/ipv4/udp.c

Next file: linux/net/ipx/af_ipx.c
Previous file: linux/net/ipv4/tcp.c
Back to the patch index
Back to the overall index

diff -u --recursive --new-file v1.3.5/linux/net/ipv4/udp.c linux/net/ipv4/udp.c
@@ -428,7 +428,7 @@
 	if(skb==NULL)
   		return er;
   
-  	truesize = skb->len;
+  	truesize = skb->len - sizeof(struct udphdr);
   	copied = min(len, truesize);
 
   	/*
@@ -448,7 +448,7 @@
   
   	skb_free_datagram(skb);
   	release_sock(sk);
-  	return(truesize);
+  	return(copied);
 }
 
 /*
@@ -623,7 +623,7 @@
 {
 	skb->sk = sk;
 	skb->dev = dev;
-	skb->len = len;
+	skb_trim(skb,len);
 
 	/*
 	 *	These are supposed to be switched. 
@@ -637,8 +637,6 @@
 	 *	Charge it to the socket, dropping if the queue is full.
 	 */
 
-	skb->len = len - sizeof(*uh);  
-	 
 	if (sock_queue_rcv_skb(sk,skb)<0) 
 	{
 		udp_statistics.UdpInErrors++;

FUNET's LINUX-ADM group, linux-adm@nic.funet.fi
TCL-scripts by Sam Shen, slshen@lbl.gov with Sam's (original) version
of this