From patchwork Thu Jun 17 01:08:43 2010 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Chris Caputo X-Patchwork-Id: 55962 X-Patchwork-Delegate: davem@davemloft.net Return-Path: X-Original-To: patchwork-incoming@ozlabs.org Delivered-To: patchwork-incoming@ozlabs.org Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by ozlabs.org (Postfix) with ESMTP id B408D1007D3 for ; Thu, 17 Jun 2010 11:15:29 +1000 (EST) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1755648Ab0FQBPZ (ORCPT ); Wed, 16 Jun 2010 21:15:25 -0400 Received: from nacho.alt.net ([208.90.169.18]:33897 "EHLO nacho.alt.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1754847Ab0FQBPZ (ORCPT ); Wed, 16 Jun 2010 21:15:25 -0400 X-Greylist: delayed 400 seconds by postgrey-1.27 at vger.kernel.org; Wed, 16 Jun 2010 21:15:25 EDT Received: (qmail 32497 invoked from network); 17 Jun 2010 01:08:43 -0000 Received: from nacho.alt.net (208.90.169.18) by nacho.alt.net with SMTP; 17 Jun 2010 01:08:43 -0000 Received: by nacho.alt.net (tmda-sendmail, from uid 500); Thu, 17 Jun 2010 01:08:43 +0000 Date: Thu, 17 Jun 2010 01:08:43 +0000 (UTC) To: netdev@vger.kernel.org, Yoshifuji Hideaki Subject: Re: [PATCH] iputils/ping_common.c: avoid gethostbyaddr during ping flood In-Reply-To: Message-ID: References: MIME-Version: 1.0 X-Delivery-Agent: TMDA/1.1.12 (Macallan) From: Chris Caputo Reply-To: Chris Caputo Sender: netdev-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: netdev@vger.kernel.org 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 ------- -- To unsubscribe from this list: send the line "unsubscribe netdev" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html --- 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;