[<prev] [next>] [day] [month] [year] [list]
Message-ID: <Pine.LNX.4.64.0802061239230.31285@nacho.alt.net>
Date: Wed, 6 Feb 2008 13:02:28 +0000 (UTC)
From: Chris Caputo <ccaputo@....net>
To: netdev@...r.kernel.org
Subject: [PATCH] iputils/ping_common.c: avoid gethostbyaddr during ping flood
Unless a destination is specified by IP address, a ping flood results in a
gethostbyaddr() for every echo reply. Thus a DNS flood can accompany a
ping flood.
This patch makes it so a gethostbyaddr() is not performed with each echo
reply during a ping flood.
Signed-off-by: Chris Caputo <ccaputo@....net>
---
ping_common.c | 8 ++++----
1 file changed, 4 insertions(+), 4 deletions(-)
===================================================================
diff -ur iputils-s20071127/ping_common.c iputils/ping_common.c
--- iputils-s20071127/ping_common.c 2007-11-27 00:57:27.000000000 +0000
+++ iputils/ping_common.c 2008-02-06 12:38:01.000000000 +0000
@@ -114,10 +114,6 @@
case 'd':
options |= F_SO_DEBUG;
break;
- case 'f':
- options |= F_FLOOD;
- setbuf(stdout, (char *)NULL);
- break;
case 'i': /* wait between sending packets */
{
if (strchr(optarg, '.')) {
@@ -168,6 +164,10 @@
exit(2);
}
break;
+ case 'f':
+ options |= F_FLOOD;
+ setbuf(stdout, (char *)NULL);
+ /* fallthrough to numeric - avoid gethostbyaddr during flood */
case 'n':
options |= F_NUMERIC;
break;
--
To unsubscribe from this list: send the line "unsubscribe netdev" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Powered by blists - more mailing lists