[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-Id: <20230719185106.17614-11-gioele@svario.it>
Date: Wed, 19 Jul 2023 20:50:54 +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 10/22] lib/rt_names: Read rt_protos from /etc and /usr
Signed-off-by: Gioele Barabucci <gioele@...rio.it>
---
lib/rt_names.c | 8 ++++++--
1 file changed, 6 insertions(+), 2 deletions(-)
diff --git a/lib/rt_names.c b/lib/rt_names.c
index f64602b5..142954cd 100644
--- a/lib/rt_names.c
+++ b/lib/rt_names.c
@@ -156,10 +156,14 @@ static void rtnl_rtprot_initialize(void)
{
struct dirent *de;
DIR *d;
+ int ret;
rtnl_rtprot_init = 1;
- rtnl_tab_initialize(CONF_ETC_DIR "/rt_protos",
- rtnl_rtprot_tab, 256);
+ ret = rtnl_tab_initialize(CONF_ETC_DIR "/rt_protos",
+ rtnl_rtprot_tab, 256);
+ if (ret == -ENOENT)
+ rtnl_tab_initialize(CONF_USR_DIR "/rt_protos",
+ rtnl_rtprot_tab, 256);
d = opendir(CONF_ETC_DIR "/rt_protos.d");
if (!d)
--
2.39.2
Powered by blists - more mailing lists