* [PATCH] iputils/ping_common.c: avoid gethostbyaddr during ping flood
@ 2008-02-06 13:02 Chris Caputo
0 siblings, 0 replies; 4+ messages in thread
From: Chris Caputo @ 2008-02-06 13:02 UTC (permalink / raw)
To: netdev
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@alt.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;
^ permalink raw reply [flat|nested] 4+ messages in thread
* Re: [PATCH] iputils/ping_common.c: avoid gethostbyaddr during ping flood
@ 2008-02-06 14:02 Chris Caputo
2010-06-17 1:08 ` Chris Caputo
0 siblings, 1 reply; 4+ messages in thread
From: Chris Caputo @ 2008-02-06 14:02 UTC (permalink / raw)
To: netdev
[Resend with whitespace preserved.]
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@alt.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;
^ permalink raw reply [flat|nested] 4+ messages in thread
* Re: [PATCH] iputils/ping_common.c: avoid gethostbyaddr during ping flood
2008-02-06 14:02 [PATCH] iputils/ping_common.c: avoid gethostbyaddr during ping flood Chris Caputo
@ 2010-06-17 1:08 ` Chris Caputo
2010-06-17 2:08 ` YOSHIFUJI Hideaki
0 siblings, 1 reply; 4+ messages in thread
From: Chris Caputo @ 2010-06-17 1:08 UTC (permalink / raw)
To: netdev, Yoshifuji Hideaki
On Wed, 6 Feb 2008, Chris Caputo wrote:
> 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.
Updated for iputils-s20100418... Can someone review and work into next
release?
Thanks,
Chris
---
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@alt.net>
-------
--- iputils-s20100418/ping_common.c 2010-04-18 04:45:45.000000000 +0000
+++ iputils-dev/ping_common.c 2010-06-17 01:00:59.000000000 +0000
@@ -118,10 +118,6 @@ void common_options(int ch)
case 'D':
options |= F_PTIMEOFDAY;
break;
- case 'f':
- options |= F_FLOOD;
- setbuf(stdout, (char *)NULL);
- break;
case 'i': /* wait between sending packets */
{
if (strchr(optarg, '.')) {
@@ -183,6 +179,10 @@ void common_options(int ch)
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;
^ permalink raw reply [flat|nested] 4+ messages in thread
* Re: [PATCH] iputils/ping_common.c: avoid gethostbyaddr during ping flood
2010-06-17 1:08 ` Chris Caputo
@ 2010-06-17 2:08 ` YOSHIFUJI Hideaki
0 siblings, 0 replies; 4+ messages in thread
From: YOSHIFUJI Hideaki @ 2010-06-17 2:08 UTC (permalink / raw)
To: Chris Caputo; +Cc: netdev
Chris Caputo wrote:
> On Wed, 6 Feb 2008, Chris Caputo wrote:
>> 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.
>
> Updated for iputils-s20100418... Can someone review and work into next
> release?
Applied, thanks.
--yoshfuji
^ permalink raw reply [flat|nested] 4+ messages in thread
end of thread, other threads:[~2010-06-17 2:09 UTC | newest]
Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2008-02-06 14:02 [PATCH] iputils/ping_common.c: avoid gethostbyaddr during ping flood Chris Caputo
2010-06-17 1:08 ` Chris Caputo
2010-06-17 2:08 ` YOSHIFUJI Hideaki
-- strict thread matches above, loose matches on Subject: below --
2008-02-06 13:02 Chris Caputo
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).