naccyde / rpms / iproute

Forked from rpms/iproute 7 months ago
Clone

Blame SOURCES/0098-iplink_vrf-Complain-if-main-table-is-not-found.patch

36cfb7
From b9d228a8c22f1d9069fa0c8f98e6bd94011c5714 Mon Sep 17 00:00:00 2001
36cfb7
From: Andrea Claudi <aclaudi@redhat.com>
36cfb7
Date: Mon, 29 Apr 2019 20:08:07 +0200
36cfb7
Subject: [PATCH] iplink_vrf: Complain if main table is not found
36cfb7
36cfb7
Bugzilla: https://bugzilla.redhat.com/show_bug.cgi?id=1465646
36cfb7
Upstream Status: iproute2.git commit 84b6a3f4b5720
36cfb7
36cfb7
commit 84b6a3f4b5720aaf673c2eaad2cf60f786de077b
36cfb7
Author: Phil Sutter <phil@nwl.cc>
36cfb7
Date:   Mon Aug 21 18:36:51 2017 +0200
36cfb7
36cfb7
    iplink_vrf: Complain if main table is not found
36cfb7
36cfb7
    Signed-off-by: Phil Sutter <phil@nwl.cc>
36cfb7
    Acked-by: David Ahern <dsahern@gmail.com>
36cfb7
---
36cfb7
 ip/iplink_vrf.c | 4 +++-
36cfb7
 1 file changed, 3 insertions(+), 1 deletion(-)
36cfb7
36cfb7
diff --git a/ip/iplink_vrf.c b/ip/iplink_vrf.c
36cfb7
index 370bb86815a80..9c2de2732a88e 100644
36cfb7
--- a/ip/iplink_vrf.c
36cfb7
+++ b/ip/iplink_vrf.c
36cfb7
@@ -127,7 +127,9 @@ __u32 ipvrf_get_table(const char *name)
36cfb7
 	if (rtnl_talk_suppress_rtnl_errmsg(&rth, &req.n, &answer) < 0) {
36cfb7
 		/* special case "default" vrf to be the main table */
36cfb7
 		if (errno == ENODEV && !strcmp(name, "default"))
36cfb7
-			rtnl_rttable_a2n(&tb_id, "main");
36cfb7
+			if (rtnl_rttable_a2n(&tb_id, "main"))
36cfb7
+				fprintf(stderr,
36cfb7
+					"BUG: RTTable \"main\" not found.\n");
36cfb7
 
36cfb7
 		return tb_id;
36cfb7
 	}
36cfb7
-- 
e138d9
2.21.0
36cfb7