From patchwork Tue May 3 04:01:07 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: 617746 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Received: from lists.ozlabs.org (lists.ozlabs.org [103.22.144.68]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 3qzSDT6Y26z9t49 for ; Tue, 3 May 2016 14:02:17 +1000 (AEST) Received: from ozlabs.org (lists.ozlabs.org [IPv6:2401:3900:2:1::3]) by lists.ozlabs.org (Postfix) with ESMTP id 3qzSDT5nGCzDqBW for ; Tue, 3 May 2016 14:02:17 +1000 (AEST) X-Original-To: slof@lists.ozlabs.org Delivered-To: slof@lists.ozlabs.org Received: from e23smtp09.au.ibm.com (e23smtp09.au.ibm.com [202.81.31.142]) (using TLSv1.2 with cipher CAMELLIA256-SHA (256/256 bits)) (No client certificate requested) by lists.ozlabs.org (Postfix) with ESMTPS id 3qzSDN09xGzDq6B for ; Tue, 3 May 2016 14:02:12 +1000 (AEST) Received: from localhost by e23smtp09.au.ibm.com with IBM ESMTP SMTP Gateway: Authorized Use Only! Violators will be prosecuted for from ; Tue, 3 May 2016 14:02:10 +1000 Received: from d23dlp02.au.ibm.com (202.81.31.213) by e23smtp09.au.ibm.com (202.81.31.206) with IBM ESMTP SMTP Gateway: Authorized Use Only! Violators will be prosecuted; Tue, 3 May 2016 14:02:09 +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 d23relay10.au.ibm.com (d23relay10.au.ibm.com [9.190.26.77]) by d23dlp02.au.ibm.com (Postfix) with ESMTP id 94CF22BB0057 for ; Tue, 3 May 2016 14:02:08 +1000 (EST) Received: from d23av01.au.ibm.com (d23av01.au.ibm.com [9.190.234.96]) by d23relay10.au.ibm.com (8.14.9/8.14.9/NCO v10.0) with ESMTP id u43420tM38273032 for ; Tue, 3 May 2016 14:02:08 +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 u4341Z52005889 for ; Tue, 3 May 2016 14:01:36 +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 u4341Wgp004753; Tue, 3 May 2016 14:01:35 +1000 From: Nikunj A Dadhania To: slof@lists.ozlabs.org Date: Tue, 3 May 2016 09:31:07 +0530 Message-Id: <1462248067-15346-3-git-send-email-nikunj@linux.vnet.ibm.com> X-Mailer: git-send-email 2.5.5 In-Reply-To: <1462248067-15346-1-git-send-email-nikunj@linux.vnet.ibm.com> References: <1462248067-15346-1-git-send-email-nikunj@linux.vnet.ibm.com> X-TM-AS-MML: disable X-Content-Scanned: Fidelis XPS MAILER x-cbid: 16050304-0033-0000-0000-000005BA4259 Subject: [SLOF] [PATCH v3 3/3] ping: use gateway address for routing 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" ping was failing for machine across the subnet with statically assinged IP address. The parsed gateway address was ignored in the stack because the router variable was not set. Signed-off-by: Nikunj A Dadhania Reviewed-by: Thomas Huth --- clients/net-snk/app/netapps/ping.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/clients/net-snk/app/netapps/ping.c b/clients/net-snk/app/netapps/ping.c index bd8f2d3..369951a 100644 --- a/clients/net-snk/app/netapps/ping.c +++ b/clients/net-snk/app/netapps/ping.c @@ -166,6 +166,8 @@ ping(int argc, char *argv[]) } else { memcpy(&fn_ip.own_ip, &ping_args.client_ip.integer, 4); + if (ping_args.gateway_ip.integer) + set_ipv4_router(ping_args.gateway_ip.integer); if (!ping_args.netmask) { /* Netmask is not provided, assume default according to * the network class