Re: [PATCH 10/17] Tools: hv: Gather ipv[4,6] gateway information

From: Stephen Hemminger
Date: Tue Jul 24 2012 - 12:29:32 EST


On Tue, 24 Jul 2012 09:01:34 -0700
"K. Y. Srinivasan" <kys@xxxxxxxxxxxxx> 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

--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/