[PATCH] Option to suppress "x.x.x.x sent an invalid ICMP...." ker

Greaves Tristan TM (Tristan.Greaves@icl.com)
Sun, 8 Nov 1998 20:10:13 -0000


This message is in MIME format. Since your mail reader does not understand
this format, some or all of this message may not be legible.

------_=_NextPart_000_01BE0B53.CB49B8F0
Content-Type: text/plain;
charset="iso-8859-1"

Hi all,

The attached patch patches the following files:

linux/net/ipv4/icmp.c
linux/net/ipv4/Config.in
linux/Documentation/Configure.help

Why?

There has been discussion on the list regarding the:

x.x.x.x sent an invalid ICMP error to a broadcast

... kernel message, which can occur if a router is not being RFC 1122
compliant by sending error responses to invalid broadcasts.

Naturally, the router should be fixed to stop this from happening, but it
is nice to have an option to stop this message from appearing! For
example, the problem exists here and we are now aware of it, but the
kernel message is clogging up /var/log/messages.

This patch gives the option:

IP: Ignore bogus broadcast responses from routers

in the kernel configuration. It defaults to "N", so only users that are
fed up with the error message appearing need to use it.

I hope this patch is of use.

Please reply through this list, or to:

Tristan.Greaves@icl.com

Tris.

---
Tristan Greaves                        (Systems Integrator) 
Enterprise Solutions                 
ICL                                  Tel: +44 (0)1344 472512 
Lovelace Road                     Mobile: +44 (0)7970 194624 
Bracknell RG12 8SN                  Mail: Tristan.Greaves@icl.com
  

------_=_NextPart_000_01BE0B53.CB49B8F0 Content-Type: application/octet-stream; name="ignore_bogus_broadcasts.patch" Content-Transfer-Encoding: quoted-printable Content-Disposition: attachment; filename="ignore_bogus_broadcasts.patch" Content-Location: ATT-0-08AB4D05BB75D211882B00A0C984DC86-I GNOR%7EDQ.PAT

--- linux/net/ipv4/icmp.c.orig Thu Nov 5 21:28:37 1998=0A= +++ linux/net/ipv4/icmp.c Thu Nov 5 21:29:40 1998=0A= @@ -50,6 +50,8 @@=0A= * Yu Tianli : Fixed two ugly bugs in icmp_send=0A= * - IP option length was accounted wrongly=0A= * - ICMP header length was not accounted at all.=0A= + * Tristan Greaves : Added option to ignore bogus broadcast=0A= + * responses from broken routers.=0A= *=0A= * To Fix:=0A= *=0A= @@ -694,16 +696,21 @@=0A= * bogus responses to broadcast frames. If you see this message=0A= * first check your netmask matches at both ends, if it does then=0A= * get the other vendor to fix their kit.=0A= + *=0A= + * There is now a kernel option to stop this error from appearing - = if the broken=0A= + * router concerned is out of the users' control it can be very = annoying!=0A= */=0A= =0A= +#ifndef CONFIG_IP_IGNORE_BOGUS_BROADCAST_RESPONSES=0A= if (inet_addr_type(iph->daddr) =3D=3D RTN_BROADCAST)=0A= {=0A= if (net_ratelimit())=0A= printk(KERN_WARNING "%s sent an invalid ICMP error to a = broadcast.\n",=0A= in_ntoa(skb->nh.iph->saddr));=0A= +=0A= return; =0A= }=0A= -=0A= +#endif=0A= =0A= /*=0A= * Deliver ICMP message to raw sockets. Pretty useless feature?=0A= --- linux/net/ipv4/Config.in.orig Thu Nov 5 21:28:29 1998=0A= +++ linux/net/ipv4/Config.in Thu Nov 5 21:29:31 1998=0A= @@ -70,6 +70,7 @@=0A= fi=0A= fi=0A= bool 'IP: TCP syncookie support (not enabled per default) ' = CONFIG_SYN_COOKIES=0A= +bool 'IP: Ignore bogus broadcast responses from routers ' = CONFIG_IP_IGNORE_BOGUS_BROADCAST_RESPONSES=0A= comment '(it is safe to leave these untouched)'=0A= #bool 'IP: PC/TCP compatibility mode' CONFIG_INET_PCTCP=0A= tristate 'IP: Reverse ARP' CONFIG_INET_RARP=0A= --- linux/Documentation/Configure.help.orig Thu Nov 5 21:29:09 1998=0A= +++ linux/Documentation/Configure.help Thu Nov 5 21:29:22 1998=0A= @@ -1065,6 +1065,20 @@=0A= =0A= If unsure, say Y.=0A= =0A= +Ignore bogus broadcast reponses from routers=0A= +CONFIG_IP_IGNORE_BOGUS_BROADCAST_RESPONSES=0A= + Some routers violate RFC 1122 by sending bogus responses to=0A= + broadcast frames.=0A= +=0A= + Normally, you should have this option set to N so that you = receive=0A= + kernel messages when this occurs.=0A= +=0A= + However, if it is happening and the broken router is out of your=0A= + control, you may wish to answer Y so that the messages do not = flood=0A= + your logs.=0A= +=0A= + If unsure, say N.=0A= + =0A= Sun floppy controller support=0A= CONFIG_BLK_DEV_SUNFD=0A= This is support for floppy drives on Sun SPARC workstations. Say = Y=0A=

------_=_NextPart_000_01BE0B53.CB49B8F0--

- To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to majordomo@vger.rutgers.edu Please read the FAQ at http://www.tux.org/lkml/