patch-2.1.29 linux/net/ipv6/udp.c

Next file: linux/net/unix/af_unix.c
Previous file: linux/net/ipv6/ndisc.c
Back to the patch index
Back to the overall index

diff -u --recursive --new-file v2.1.28/linux/net/ipv6/udp.c linux/net/ipv6/udp.c
@@ -7,7 +7,7 @@
  *
  *	Based on linux/ipv4/udp.c
  *
- *	$Id: udp.c,v 1.8 1997/02/28 09:56:35 davem Exp $
+ *	$Id: udp.c,v 1.9 1997/03/04 10:41:59 davem Exp $
  *
  *	This program is free software; you can redistribute it and/or
  *      modify it under the terms of the GNU General Public License
@@ -324,9 +324,10 @@
 	if(skb==NULL)
   		return err;
   
-  	truesize = skb->tail - skb->h.raw - sizeof(struct udphdr);
+ 	truesize=ntohs(((struct udphdr *)skb->h.raw)->len) - sizeof(struct udphdr);
   	
   	copied=truesize;
+
   	if(copied>len)
   	{
   		copied=len;
@@ -357,7 +358,7 @@
 		if (skb->protocol == __constant_htons(ETH_P_IP))
 		{
 			ipv6_addr_set(&sin6->sin6_addr, 0, 0,
-				      __constant_htonl(0xffff), skb->nh.iph->daddr);
+				      __constant_htonl(0xffff), skb->nh.iph->saddr);
 		}
 		else
 		{

FUNET's LINUX-ADM group, linux-adm@nic.funet.fi
TCL-scripts by Sam Shen, slshen@lbl.gov