patch-2.1.12 linux/net/ipv4/ip_output.c

Next file: linux/net/ipv4/tcp_timer.c
Previous file: linux/net/ax25/ax25_timer.c
Back to the patch index
Back to the overall index

diff -u --recursive --new-file v2.1.11/linux/net/ipv4/ip_output.c linux/net/ipv4/ip_output.c
@@ -387,7 +387,9 @@
 	 */
 
 	if (tot_len > dev->mtu)
+	{
 		goto fragment;
+	}
 
 	/*
 	 *	Add an IP checksum
@@ -478,6 +480,13 @@
 	goto out;
 
 fragment:
+	if ((iph->frag_off & htons(IP_DF)))
+	{
+		printk(KERN_DEBUG "sending pkt_too_big to self\n");
+		icmp_send(skb, ICMP_DEST_UNREACH, ICMP_FRAG_NEEDED,
+			  htonl(dev->mtu), dev);
+		goto out;
+	}
 	ip_fragment(sk,skb,dev,0);
 	goto out;
 }

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