From patchwork Mon May 2 10:05:49 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: 617453 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 3qz0Mp4SKQz9syq for ; Mon, 2 May 2016 20:07:02 +1000 (AEST) Received: from ozlabs.org (lists.ozlabs.org [IPv6:2401:3900:2:1::3]) by lists.ozlabs.org (Postfix) with ESMTP id 3qz0Mp3s1XzDqHH for ; Mon, 2 May 2016 20:07:02 +1000 (AEST) X-Original-To: slof@lists.ozlabs.org Delivered-To: slof@lists.ozlabs.org Received: from e23smtp07.au.ibm.com (e23smtp07.au.ibm.com [202.81.31.140]) (using TLSv1.2 with cipher CAMELLIA256-SHA (256/256 bits)) (No client certificate requested) by lists.ozlabs.org (Postfix) with ESMTPS id 3qz0Mm161xzDqD8 for ; Mon, 2 May 2016 20:07:00 +1000 (AEST) Received: from localhost by e23smtp07.au.ibm.com with IBM ESMTP SMTP Gateway: Authorized Use Only! Violators will be prosecuted for from ; Mon, 2 May 2016 20:06:58 +1000 Received: from d23dlp01.au.ibm.com (202.81.31.203) by e23smtp07.au.ibm.com (202.81.31.204) with IBM ESMTP SMTP Gateway: Authorized Use Only! Violators will be prosecuted; Mon, 2 May 2016 20:06:56 +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 d23relay09.au.ibm.com (d23relay09.au.ibm.com [9.185.63.181]) by d23dlp01.au.ibm.com (Postfix) with ESMTP id 89BB12CE8046 for ; Mon, 2 May 2016 20:06:55 +1000 (EST) Received: from d23av03.au.ibm.com (d23av03.au.ibm.com [9.190.234.97]) by d23relay09.au.ibm.com (8.14.9/8.14.9/NCO v10.0) with ESMTP id u42A6lRm1376766 for ; Mon, 2 May 2016 20:06:55 +1000 Received: from d23av03.au.ibm.com (localhost [127.0.0.1]) by d23av03.au.ibm.com (8.14.4/8.14.4/NCO v10.0 AVout) with ESMTP id u42A6Na6000480 for ; Mon, 2 May 2016 20:06:23 +1000 Received: from abhimanyu.in.ibm.com (abhimanyu.in.ibm.com [9.124.35.92]) by d23av03.au.ibm.com (8.14.4/8.14.4/NCO v10.0 AVin) with ESMTP id u42A6Jd5032535; Mon, 2 May 2016 20:06:22 +1000 From: Nikunj A Dadhania To: slof@lists.ozlabs.org Date: Mon, 2 May 2016 15:35:49 +0530 Message-Id: <1462183549-5408-3-git-send-email-nikunj@linux.vnet.ibm.com> X-Mailer: git-send-email 2.5.5 In-Reply-To: <1462183549-5408-1-git-send-email-nikunj@linux.vnet.ibm.com> References: <1462183549-5408-1-git-send-email-nikunj@linux.vnet.ibm.com> X-TM-AS-MML: disable X-Content-Scanned: Fidelis XPS MAILER x-cbid: 16050210-0025-0000-0000-000004809CA0 Subject: [SLOF] [PATCH v2 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 --- 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 3e4d440..6cce88d 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) set_ipv4_netmask(ping_args.netmask);