[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-Id: <20230719185106.17614-12-gioele@svario.it>
Date: Wed, 19 Jul 2023 20:50:55 +0200
From: Gioele Barabucci <gioele@...rio.it>
To: netdev@...r.kernel.org
Cc: Stephen Hemminger <stephen@...workplumber.org>,
Gioele Barabucci <gioele@...rio.it>
Subject: [iproute2 11/22] lib/rt_names: Read rt_scopes from /etc and /usr
Signed-off-by: Gioele Barabucci <gioele@...rio.it>
---
lib/rt_names.c | 9 +++++++--
1 file changed, 7 insertions(+), 2 deletions(-)
diff --git a/lib/rt_names.c b/lib/rt_names.c
index 142954cd..37f85ded 100644
--- a/lib/rt_names.c
+++ b/lib/rt_names.c
@@ -305,9 +305,14 @@ static int rtnl_rtscope_init;
static void rtnl_rtscope_initialize(void)
{
+ int ret;
+
rtnl_rtscope_init = 1;
- rtnl_tab_initialize(CONF_ETC_DIR "/rt_scopes",
- rtnl_rtscope_tab, 256);
+ ret = rtnl_tab_initialize(CONF_ETC_DIR "/rt_scopes",
+ rtnl_rtscope_tab, 256);
+ if (ret == -ENOENT)
+ rtnl_tab_initialize(CONF_USR_DIR "/rt_scopes",
+ rtnl_rtscope_tab, 256);
}
const char *rtnl_rtscope_n2a(int id, char *buf, int len)
--
2.39.2
Powered by blists - more mailing lists