mirror of
https://github.com/kernelkit/infix.git
synced 2026-08-01 13:23:01 +02:00
confd: Stop bfdd if ospf is removed
This was not handled in the previous design.
This commit is contained in:
@@ -15,6 +15,7 @@
|
||||
#define OSPFD_CONF_NEXT OSPFD_CONF "+"
|
||||
#define OSPFD_CONF_PREV OSPFD_CONF "-"
|
||||
#define BFDD_CONF "/etc/frr/bfd_enabled" /* Just signal that bfd should be enabled*/
|
||||
#define BFDD_CONF_NEXT BFDD_CONF "+"
|
||||
|
||||
#define FRR_STATIC_CONFIG "! Generated by Infix\n\
|
||||
frr defaults traditional\n\
|
||||
@@ -169,7 +170,7 @@ int parse_ospf(sr_session_ctx_t *session, struct lyd_node *ospf)
|
||||
}
|
||||
|
||||
if (bfd_enabled)
|
||||
(void)touch(BFDD_CONF);
|
||||
(void)touch(BFDD_CONF_NEXT);
|
||||
|
||||
return 0;
|
||||
}
|
||||
@@ -258,7 +259,7 @@ static int change_control_plane_protocols(sr_session_ctx_t *session, uint32_t su
|
||||
/* Check if passed validation in previous event */
|
||||
staticd_enabled = fexist(STATICD_CONF_NEXT);
|
||||
ospfd_enabled = fexist(OSPFD_CONF_NEXT);
|
||||
bfdd_enabled = fexist(BFDD_CONF);
|
||||
bfdd_enabled = fexist(BFDD_CONF_NEXT);
|
||||
staticd_running = !systemf("initctl -bfq status staticd");
|
||||
ospfd_running = !systemf("initctl -bfq status ospfd");
|
||||
bfdd_running = !systemf("initctl -bfq status bfdd");
|
||||
@@ -293,6 +294,7 @@ static int change_control_plane_protocols(sr_session_ctx_t *session, uint32_t su
|
||||
}
|
||||
|
||||
if (bfdd_enabled) {
|
||||
(void)rename(BFDD_CONF_NEXT, BFDD_CONF);
|
||||
if (!bfdd_running) {
|
||||
if (systemf("initctl -bfq enable bfdd")) {
|
||||
ERROR("Failed to enable OSPF routing daemon");
|
||||
|
||||
Reference in New Issue
Block a user