From: Maciej Soltysiak <solt@dns.toxicfilms.tv>
To: davem@caip.rutgers.edu
Cc: Eric.Schenk@dna.lth.se, linux-kernel@vger.kernel.org
Subject: [PATCH] make icmp.c be more verbose on broadcast icmp errors
Date: Fri, 23 May 2003 12:55:03 +0200 (CEST) [thread overview]
Message-ID: <Pine.LNX.4.51.0305231222450.8169@dns.toxicfilms.tv> (raw)
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
+++ linux-2.5.69/net/ipv4/icmp.c 2003-05-23 12:15:45.000000000 +0200
@@ -663,8 +659,10 @@
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
+++ linux/net/ipv4/icmp.c 2003-05-23 12:20:46.000000000 +0200
@@ -625,8 +595,9 @@
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;
}
}
next reply other threads:[~2003-05-23 10:42 UTC|newest]
Thread overview: 5+ messages / expand[flat|nested] mbox.gz Atom feed top
2003-05-23 10:55 Maciej Soltysiak [this message]
2003-05-26 4:14 ` [PATCH] make icmp.c be more verbose on broadcast icmp errors David S. Miller
2003-05-26 5:56 ` Christoph Hellwig
2003-05-26 5:59 ` David S. Miller
2003-05-26 6:12 ` James Morris
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=Pine.LNX.4.51.0305231222450.8169@dns.toxicfilms.tv \
--to=solt@dns.toxicfilms.tv \
--cc=Eric.Schenk@dna.lth.se \
--cc=davem@caip.rutgers.edu \
--cc=linux-kernel@vger.kernel.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).