diff mbox

[v2,3/3] ping: use gateway address for routing

Message ID 1462183549-5408-3-git-send-email-nikunj@linux.vnet.ibm.com
State Superseded
Headers show

Commit Message

Nikunj A Dadhania May 2, 2016, 10:05 a.m. UTC
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 <nikunj@linux.vnet.ibm.com>
---
 clients/net-snk/app/netapps/ping.c | 2 ++
 1 file changed, 2 insertions(+)
diff mbox

Patch

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);