pimd: Fix configuration file reading upon startup
Without the fix, qpimd issues this error message:
pim_if_add_vif: ifindex=0 < 1 on interface swp1
It happens because in pim_main.c:main() we are initializing zebra with pim_zebra_init() after we read in the configuration with vty_read_config().
See also: https://github.com/udhos/qpimd/issues/3
diff --git a/pimd/pim_main.c b/pimd/pim_main.c
index c646356..b57f881 100644
--- a/pimd/pim_main.c
+++ b/pimd/pim_main.c
@@ -216,6 +216,11 @@
zlog_default->maxlvl[ZLOG_DEST_STDOUT] = ZLOG_DISABLED;
#endif
+ /*
+ Initialize zclient "update" and "lookup" sockets
+ */
+ pim_zebra_init(zebra_sock_path);
+
zlog_notice("Loading configuration - begin");
/* Get configuration file. */
@@ -278,12 +283,6 @@
zlog_notice("!HAVE_CLOCK_MONOTONIC");
#endif
-
- /*
- Initialize zclient "update" and "lookup" sockets
- */
- pim_zebra_init(zebra_sock_path);
-
while (thread_fetch(master, &thread))
thread_call(&thread);