patch-1.3.24 linux/net/ipv4/ip.c

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

diff -u --recursive --new-file v1.3.23/linux/net/ipv4/ip.c linux/net/ipv4/ip.c
@@ -90,6 +90,7 @@
  *	Gerhard Koerting	:	IP fragmentation forwarding fix
  *		Alan Cox	:	Device lock against page fault.
  *		Alan Cox	:	IP_HDRINCL facility.
+ *	Werner Almesberger	:	Zero fragment bug
  *
  *  
  *
@@ -2531,7 +2532,7 @@
 	if(length+20 <= dev->mtu && !MULTICAST(daddr) && daddr!=0xFFFFFFFF && daddr!=dev->pa_brdaddr)
 	{	
 		int error;
-		struct sk_buff *skb=sock_alloc_send_skb(sk, length+20+15+dev->hard_header_len,0,&error);
+		struct sk_buff *skb=sock_alloc_send_skb(sk, length+20+15+dev->hard_header_len,0, 0,&error);
 		if(skb==NULL)
 		{
 			ip_statistics.IpOutDiscards++;
@@ -2614,7 +2615,7 @@
 	 
 	fraglen = length - offset + fragheaderlen;
 	
-	if(fraglen==0)
+	if(length-offset==0)
 	{
 		fraglen = maxfraglen;
 		offset -= maxfraglen-fragheaderlen;
@@ -2660,7 +2661,7 @@
 		 *	Get the memory we require with some space left for alignment.
 		 */
 
-		skb = sock_alloc_send_skb(sk, fraglen+15, 0, &error);
+		skb = sock_alloc_send_skb(sk, fraglen+15, 0, 0, &error);
 		if (skb == NULL)
 		{
 			ip_statistics.IpOutDiscards++;

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