summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDonald Sharp <donaldsharp72@gmail.com>2024-11-05 14:26:20 -0500
committerGitHub <noreply@github.com>2024-11-05 14:26:20 -0500
commit4f823efd6397b83d86b30cbf5f0f978412f35141 (patch)
tree4eeb89e75069645ccd906e4ddcdc2215bb54846a
parent530b71b0ace5040c02b08f66315936dab00cdbb7 (diff)
parentefb2f7c08005832af0e7ef159fb2b5dce20bc467 (diff)
Merge pull request #17352 from FRRouting/mergify/bp/dev/10.2/pr-17319
ospfd: Use router_id what Zebra has if we remove a static router_id (backport #17319)
-rw-r--r--ospfd/ospf_vty.c7
-rw-r--r--ospfd/ospfd.c7
2 files changed, 8 insertions, 6 deletions
diff --git a/ospfd/ospf_vty.c b/ospfd/ospf_vty.c
index b7261da261..4e1c083872 100644
--- a/ospfd/ospf_vty.c
+++ b/ospfd/ospf_vty.c
@@ -339,6 +339,12 @@ DEFPY (no_ospf_router_id,
return CMD_SUCCESS;
}
+ALIAS_HIDDEN (no_ospf_router_id,
+ no_router_id_cmd,
+ "no router-id [A.B.C.D]",
+ NO_STR
+ "router-id for the OSPF process\n"
+ "OSPF router-id in IP address format\n")
static void ospf_passive_interface_default_update(struct ospf *ospf,
uint8_t newval)
@@ -13624,6 +13630,7 @@ void ospf_vty_init(void)
install_element(OSPF_NODE, &ospf_router_id_cmd);
install_element(OSPF_NODE, &ospf_router_id_old_cmd);
install_element(OSPF_NODE, &no_ospf_router_id_cmd);
+ install_element(OSPF_NODE, &no_router_id_cmd);
/* "passive-interface" commands. */
install_element(OSPF_NODE, &ospf_passive_interface_default_cmd);
diff --git a/ospfd/ospfd.c b/ospfd/ospfd.c
index 7638e979a2..d72afec1e4 100644
--- a/ospfd/ospfd.c
+++ b/ospfd/ospfd.c
@@ -147,15 +147,10 @@ void ospf_process_refresh_data(struct ospf *ospf, bool reset)
/* Select the router ID based on these priorities:
1. Statically assigned router ID is always the first choice.
- 2. If there is no statically assigned router ID, then try to stick
- with the most recent value, since changing router ID's is very
- disruptive.
- 3. Last choice: just go with whatever the zebra daemon recommends.
+ 2. Just go with whatever the zebra daemon recommends.
*/
if (ospf->router_id_static.s_addr != INADDR_ANY)
router_id = ospf->router_id_static;
- else if (ospf->router_id.s_addr != INADDR_ANY)
- router_id = ospf->router_id;
else
router_id = ospf->router_id_zebra;