From patchwork Tue May 3 04:01:05 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: 617745 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 3qzSDS2lz8z9t49 for ; Tue, 3 May 2016 14:02:16 +1000 (AEST) Received: from ozlabs.org (lists.ozlabs.org [IPv6:2401:3900:2:1::3]) by lists.ozlabs.org (Postfix) with ESMTP id 3qzSDS23xTzDqCG for ; Tue, 3 May 2016 14:02:16 +1000 (AEST) X-Original-To: slof@lists.ozlabs.org Delivered-To: slof@lists.ozlabs.org Received: from e23smtp05.au.ibm.com (e23smtp05.au.ibm.com [202.81.31.147]) (using TLSv1.2 with cipher CAMELLIA256-SHA (256/256 bits)) (No client certificate requested) by lists.ozlabs.org (Postfix) with ESMTPS id 3qzSDM40WYzDq6B for ; Tue, 3 May 2016 14:02:11 +1000 (AEST) Received: from localhost by e23smtp05.au.ibm.com with IBM ESMTP SMTP Gateway: Authorized Use Only! Violators will be prosecuted for from ; Tue, 3 May 2016 14:02:08 +1000 Received: from d23dlp01.au.ibm.com (202.81.31.203) by e23smtp05.au.ibm.com (202.81.31.211) with IBM ESMTP SMTP Gateway: Authorized Use Only! Violators will be prosecuted; Tue, 3 May 2016 14:02:07 +1000 X-IBM-Helo: d23dlp01.au.ibm.com X-IBM-MailFrom: nikunj@linux.vnet.ibm.com X-IBM-RcptTo: slof@lists.ozlabs.org Received: from d23relay08.au.ibm.com (d23relay08.au.ibm.com [9.185.71.33]) by d23dlp01.au.ibm.com (Postfix) with ESMTP id 63E992CE8046 for ; Tue, 3 May 2016 14:02:06 +1000 (EST) Received: from d23av01.au.ibm.com (d23av01.au.ibm.com [9.190.234.96]) by d23relay08.au.ibm.com (8.14.9/8.14.9/NCO v10.0) with ESMTP id u4341wNe56230050 for ; Tue, 3 May 2016 14:02:06 +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 u4341XTf005746 for ; Tue, 3 May 2016 14:01:34 +1000 Received: from abhimanyu.in.ibm.com (abhimanyu.in.ibm.com [9.124.35.92]) by d23av01.au.ibm.com (8.14.4/8.14.4/NCO v10.0 AVin) with ESMTP id u4341Wgn004753; Tue, 3 May 2016 14:01:33 +1000 From: Nikunj A Dadhania To: slof@lists.ozlabs.org Date: Tue, 3 May 2016 09:31:05 +0530 Message-Id: <1462248067-15346-1-git-send-email-nikunj@linux.vnet.ibm.com> X-Mailer: git-send-email 2.5.5 X-TM-AS-MML: disable X-Content-Scanned: Fidelis XPS MAILER x-cbid: 16050304-0017-0000-0000-000004689808 Subject: [SLOF] [PATCH v3 1/3] ping: report success on localhost ping X-BeenThere: slof@lists.ozlabs.org X-Mailman-Version: 2.1.22 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 Reviewed-by: Thomas Huth --- 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 2c7dadb..4facf06 100644 --- a/clients/net-snk/app/netapps/ping.c +++ b/clients/net-snk/app/netapps/ping.c @@ -180,6 +180,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);