iplink_vrf: Complain if main table is not found

Signed-off-by: Phil Sutter <phil@nwl.cc>
Acked-by: David Ahern <dsahern@gmail.com>
This commit is contained in:
Phil Sutter 2017-08-21 18:36:51 +02:00 committed by Stephen Hemminger
parent 7c66d89828
commit 84b6a3f4b5
1 changed files with 3 additions and 1 deletions

View File

@ -131,7 +131,9 @@ __u32 ipvrf_get_table(const char *name)
&answer.n, sizeof(answer)) < 0) {
/* special case "default" vrf to be the main table */
if (errno == ENODEV && !strcmp(name, "default"))
rtnl_rttable_a2n(&tb_id, "main");
if (rtnl_rttable_a2n(&tb_id, "main"))
fprintf(stderr,
"BUG: RTTable \"main\" not found.\n");
return tb_id;
}