make icmp.c be more verbose on broadcast icmp errors

make icmp.c be more verbose on broadcast icmp errors

Post by Maciej Soltysia » Sat, 24 May 2003 13:00:15



Hi,

I noticed today in my logs something like:
1.2.3.4 sent an invalid ICMP error to a broadcast address.

And i though that it would be nice to make it report what code/type was
it. So here goes:

2.5 version:

diff -Nru linux-2.5.69.bak/net/ipv4/icmp.c linux-2.5.68/net/ipv4/icmp.c
--- linux-2.5.69.bak/net/ipv4/icmp.c    2003-05-17 14:56:11.000000000 +0200

            inet_addr_type(iph->daddr) == RTN_BROADCAST) {
                if (net_ratelimit())
                        printk(KERN_WARNING "%u.%u.%u.%u sent an invalid ICMP "
+                                           "type %u, code %u "
                                            "error to a broadcast.\n",
-                              NIPQUAD(skb->nh.iph->saddr));
+                              NIPQUAD(skb->nh.iph->saddr),
+                              icmph->type, icmph->code);
                goto out;
        }

2.4 Version:
diff -Nru linux.bak/net/ipv4/icmp.c linux/net/ipv4/icmp.c
--- linux.bak/net/ipv4/icmp.c   2003-04-30 15:57:40.000000000 +0200

                if (inet_addr_type(iph->daddr) == RTN_BROADCAST)
                {
                        if (net_ratelimit())
-                               printk(KERN_WARNING "%u.%u.%u.%u sent an invalid ICMP error to a broadcast.\n",
-                               NIPQUAD(skb->nh.iph->saddr));
+                               printk(KERN_WARNING "%u.%u.%u.%u sent an invalid ICMP type %u, code %u error to a broadcast.\n",
+                               NIPQUAD(skb->nh.iph->saddr),
+                               icmph->type, icmph->code);
                        goto out;
                }
        }
-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in

More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/

 
 
 

make icmp.c be more verbose on broadcast icmp errors

Post by David S. Mille » Tue, 27 May 2003 06:20:06


None of the people on the CC: list maintain the networking
code, I have no idea where you've obtained that outdated
contact information.  Eric hasn't done networking work for
at least 4 or 5 years, and it's been a similarly long time
since I've ever used that old rutgers.edu address for myself.

Also, linux-kernel is not the place for networking patches
and discussion, linux-net and netdev are.

--

-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in

More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/

 
 
 

make icmp.c be more verbose on broadcast icmp errors

Post by Christoph Hellwi » Tue, 27 May 2003 08:00:14



> None of the people on the CC: list maintain the networking
> code, I have no idea where you've obtained that outdated
> contact information.  Eric hasn't done networking work for
> at least 4 or 5 years, and it's been a similarly long time
> since I've ever used that old rutgers.edu address for myself.

net/README:

---- snip ----


---- snip ----

probably this file should be removed completly - it's horribly outdated
and we have MAINTAINERS for that purpose..

-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in

More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/

 
 
 

make icmp.c be more verbose on broadcast icmp errors

Post by David S. Mille » Tue, 27 May 2003 08:10:07



   Date: Mon, 26 May 2003 06:56:02 +0100

   net/README:
 ...  
   probably this file should be removed completly - it's horribly outdated
   and we have MAINTAINERS for that purpose..

Oh yes, let's kill that thing :-)
-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in

More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/

 
 
 

make icmp.c be more verbose on broadcast icmp errors

Post by James Morri » Tue, 27 May 2003 08:20:08



>            if (net_ratelimit())
>                    printk(KERN_WARNING "%u.%u.%u.%u sent an invalid ICMP "
> +                                      "type %u, code %u "
>                                        "error to a broadcast.\n",
> -                         NIPQUAD(skb->nh.iph->saddr));
> +                         NIPQUAD(skb->nh.iph->saddr),
> +                         icmph->type, icmph->code);
>                    if (net_ratelimit())
> -                          printk(KERN_WARNING "%u.%u.%u.%u sent an invalid ICMP error to a broadcast.\n",
> -                          NIPQUAD(skb->nh.iph->saddr));
> +                          printk(KERN_WARNING "%u.%u.%u.%u sent an invalid ICMP type %u, code %u error to a broadcast.\n",
> +                          NIPQUAD(skb->nh.iph->saddr),
> +                          icmph->type, icmph->code);

Perhaps make this a static inline, icmp_warn_invalid() or similar.

- James
--
James Morris

-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in

More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/

 
 
 

1. blah sent up an invalid ICMP error to a broadcast.

I have an OpenBSD firewall appliance that is reporting to its console:

AAA.BBB.CCC.DDD sent up an invalid ICMP error to a broadcast.

The other interesting thing about this is that the address
AAA.BBB.CCC.DDD is an internal interface on the OpenBSD firewall
appliance, the same device that is reporting it.

Does anyone have any clues as to what is going on here?

Thanks
Ben

2. HDLC, pc-104, and Linux?

3. gateway sends an invalid ICMP error to a broadcast(?!)

4. Audio/x-midi plug-in for Netscape

5. <gatewayIP> sent an invalid ICMP error to a broadcast

6. Upgrading Apache - htaccess doesn't work

7. gateway sends an invalid ICMP error to a broadcast(?!)

8. Q: Syquest IDE and Linux

9. 191.1.1.5 sent an invalid ICMP error to a broadcast

10. icmp : does icmp have no dependency on dns?

11. ICMP HOST cannot build IP Header address to echo ICMP HOST

12. 2.5.70 invalid icmp broadcast.

13. ICMP Ping to broadcast broken ?