patch-2.1.132 linux/net/ipv4/icmp.c

Next file: linux/net/ipv4/sysctl_net_ipv4.c
Previous file: linux/net/decnet/README
Back to the patch index
Back to the overall index

diff -u --recursive --new-file v2.1.131/linux/net/ipv4/icmp.c linux/net/ipv4/icmp.c
@@ -50,6 +50,8 @@
  *		Yu Tianli	:	Fixed two ugly bugs in icmp_send
  *					- IP option length was accounted wrongly
  *					- ICMP header length was not accounted at all.
+ *              Tristan Greaves :       Added sysctl option to ignore bogus broadcast
+ *                                      responses from broken routers.
  *
  * To Fix:
  *
@@ -311,6 +313,9 @@
 int sysctl_icmp_echo_ignore_all = 0;
 int sysctl_icmp_echo_ignore_broadcasts = 0;
 
+/* Control parameter - ignore bogus broadcast responses? */
+int sysctl_icmp_ignore_bogus_error_responses =0;
+
 /*
  *	ICMP control array. This specifies what to do with each ICMP.
  */
@@ -701,16 +706,19 @@
 	 *	first check your netmask matches at both ends, if it does then
 	 *	get the other vendor to fix their kit.
 	 */
-	 
-	if (inet_addr_type(iph->daddr) == RTN_BROADCAST)
+
+	if (!sysctl_icmp_ignore_bogus_error_responses)
 	{
-		if (net_ratelimit())
-			printk(KERN_WARNING "%s sent an invalid ICMP error to a broadcast.\n",
-			       in_ntoa(skb->nh.iph->saddr));
-		return; 
+	
+		if (inet_addr_type(iph->daddr) == RTN_BROADCAST)
+		{
+			if (net_ratelimit())
+				printk(KERN_WARNING "%s sent an invalid ICMP error to a broadcast.\n",
+			       	in_ntoa(skb->nh.iph->saddr));
+			return; 
+		}
 	}
 
-
 	/*
 	 *	Deliver ICMP message to raw sockets. Pretty useless feature?
 	 */
@@ -886,8 +894,10 @@
 
 static void icmp_address(struct icmphdr *icmph, struct sk_buff *skb, int len)
 {
+#if 0
 	if (net_ratelimit())
 		printk(KERN_DEBUG "a guy asks for address mask. Who is it?\n");
+#endif		
 }
 
 /*

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