From patchwork Wed Apr 13 07:03:52 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Nikunj A Dadhania X-Patchwork-Id: 609877 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Received: from lists.ozlabs.org (lists.ozlabs.org [IPv6:2401:3900:2:1::3]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 3qlFDm1wwhz9t3n for ; Wed, 13 Apr 2016 17:05:12 +1000 (AEST) Received: from lists.ozlabs.org (lists.ozlabs.org [IPv6:2401:3900:2:1::3]) by lists.ozlabs.org (Postfix) with ESMTP id 3qlFDm1CcMzDqBV for ; Wed, 13 Apr 2016 17:05:12 +1000 (AEST) X-Original-To: slof@lists.ozlabs.org Delivered-To: slof@lists.ozlabs.org Received: from e23smtp06.au.ibm.com (e23smtp06.au.ibm.com [202.81.31.148]) (using TLSv1.2 with cipher CAMELLIA256-SHA (256/256 bits)) (No client certificate requested) by lists.ozlabs.org (Postfix) with ESMTPS id 3qlFDk0qfyzDqBD for ; Wed, 13 Apr 2016 17:05:10 +1000 (AEST) Received: from localhost by e23smtp06.au.ibm.com with IBM ESMTP SMTP Gateway: Authorized Use Only! Violators will be prosecuted for from ; Wed, 13 Apr 2016 17:05:08 +1000 Received: from d23dlp02.au.ibm.com (202.81.31.213) by e23smtp06.au.ibm.com (202.81.31.212) with IBM ESMTP SMTP Gateway: Authorized Use Only! Violators will be prosecuted; Wed, 13 Apr 2016 17:05:06 +1000 X-IBM-Helo: d23dlp02.au.ibm.com X-IBM-MailFrom: nikunj@linux.vnet.ibm.com X-IBM-RcptTo: slof@lists.ozlabs.org Received: from d23relay06.au.ibm.com (d23relay06.au.ibm.com [9.185.63.219]) by d23dlp02.au.ibm.com (Postfix) with ESMTP id E2B562BB0057 for ; Wed, 13 Apr 2016 17:05:05 +1000 (EST) Received: from d23av01.au.ibm.com (d23av01.au.ibm.com [9.190.234.96]) by d23relay06.au.ibm.com (8.14.9/8.14.9/NCO v10.0) with ESMTP id u3D74vjF5374228 for ; Wed, 13 Apr 2016 17:05:05 +1000 Received: from d23av01.au.ibm.com (localhost [127.0.0.1]) by d23av01.au.ibm.com (8.14.4/8.14.4/NCO v10.0 AVout) with ESMTP id u3D74XSg026553 for ; Wed, 13 Apr 2016 17:04:33 +1000 Received: from abhimanyu.in.ibm.com (abhimanyu.in.ibm.com [9.124.35.92] (may be forged)) by d23av01.au.ibm.com (8.14.4/8.14.4/NCO v10.0 AVin) with ESMTP id u3D74J3K024772; Wed, 13 Apr 2016 17:04:32 +1000 From: Nikunj A Dadhania To: slof@lists.ozlabs.org Date: Wed, 13 Apr 2016 12:33:52 +0530 Message-Id: <1460531032-17653-2-git-send-email-nikunj@linux.vnet.ibm.com> X-Mailer: git-send-email 2.5.5 In-Reply-To: <1460531032-17653-1-git-send-email-nikunj@linux.vnet.ibm.com> References: <1460531032-17653-1-git-send-email-nikunj@linux.vnet.ibm.com> X-TM-AS-MML: disable X-Content-Scanned: Fidelis XPS MAILER x-cbid: 16041307-0021-0000-0000-00000376C0CC Subject: [SLOF] [PATCH 2/2] ping: report success on localhost ping X-BeenThere: slof@lists.ozlabs.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: "Patches for https://github.com/aik/SLOF" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , MIME-Version: 1.0 Errors-To: slof-bounces+incoming=patchwork.ozlabs.org@lists.ozlabs.org Sender: "SLOF" Signed-off-by: Nikunj A Dadhania --- clients/net-snk/app/netapps/ping.c | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/clients/net-snk/app/netapps/ping.c b/clients/net-snk/app/netapps/ping.c index 1522792..4cdec81 100644 --- a/clients/net-snk/app/netapps/ping.c +++ b/clients/net-snk/app/netapps/ping.c @@ -186,6 +186,12 @@ ping(int argc, char *argv[]) ((fn_ip.server_ip >> 8) & 0xFF), (fn_ip.server_ip & 0xFF)); + // Report success on localhost ping + if (memcmp(&fn_ip.server_ip, &fn_ip.own_ip, 4) == 0) { + printf("success\n"); + return 0; + } + ping_ipv4(fd_device, fn_ip.server_ip); set_timer(TICKS_SEC / 10 * ping_args.timeout);