lkml.org 
[lkml]   [2012]   [Jul]   [24]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
From
SubjectRe: [PATCH 10/17] Tools: hv: Gather ipv[4,6] gateway information
On Tue, 24 Jul 2012 09:01:34 -0700
"K. Y. Srinivasan" <kys@microsoft.com> wrote:

> + memset(cmd, 0, sizeof(cmd));
> + strcat(cmd, "/sbin/ip -f inet route | grep -w ");
> + strcat(cmd, if_name);
> + strcat(cmd, " | awk '/default/ {print $3 }'");


Much simpler method:

ip route show match 0/0



\
 
 \ /
  Last update: 2012-07-24 19:21    [W:0.232 / U:0.276 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site