patch-2.0.34 linux/net/ipv4/ip_fragment.c

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

diff -u --recursive --new-file v2.0.33/linux/net/ipv4/ip_fragment.c linux/net/ipv4/ip_fragment.c
@@ -345,7 +345,7 @@
 	
 	if(len>65535)
 	{
-		printk("Oversized IP packet from %s.\n", in_ntoa(qp->iph->saddr));
+		NETDEBUG(printk("Oversized IP packet from %s.\n", in_ntoa(qp->iph->saddr)));
 		ip_statistics.IpReasmFails++;
 		ip_free(qp);
 		return NULL;
@@ -375,7 +375,7 @@
 	fp = qp->fragments;
 	while(fp != NULL)
 	{
-		if (fp->len < 0 || count+fp->len > skb->len)
+		if (fp->len < 0 || fp->offset+qp->ihlen+fp->len > skb->len)
 		{
 			NETDEBUG(printk("Invalid fragment list: Fragment over size.\n"));
 			ip_free(qp);
@@ -489,7 +489,7 @@
 	if(ntohs(iph->tot_len)+(int)offset>65535)
 	{
 		skb->sk = NULL;
-		printk("Oversized packet received from %s\n",in_ntoa(iph->saddr));
+		NETDEBUG(printk("Oversized packet received from %s\n",in_ntoa(iph->saddr)));
 		kfree_skb(skb, FREE_READ);
 		ip_statistics.IpReasmFails++;
 		return NULL;
@@ -698,7 +698,7 @@
 	if(mtu<8)
 	{
 		/* It's wrong but it's better than nothing */
-		icmp_send(skb,ICMP_DEST_UNREACH,ICMP_FRAG_NEEDED,dev->mtu, dev);
+		icmp_send(skb,ICMP_DEST_UNREACH,ICMP_FRAG_NEEDED,htons(dev->mtu), dev);
 		ip_statistics.IpFragFails++;
 		return;
 	}

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