forked from Mirror/frr
Merge pull request #17319 from opensourcerouting/fix/no_ospf_router-id
ospfd: Use router_id what Zebra has if we remove a static router_id
This commit is contained in:
commit
408decfd77
|
@ -339,6 +339,12 @@ DEFPY (no_ospf_router_id,
|
||||||
return CMD_SUCCESS;
|
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,
|
static void ospf_passive_interface_default_update(struct ospf *ospf,
|
||||||
uint8_t newval)
|
uint8_t newval)
|
||||||
|
@ -13603,6 +13609,7 @@ void ospf_vty_init(void)
|
||||||
install_element(OSPF_NODE, &ospf_router_id_cmd);
|
install_element(OSPF_NODE, &ospf_router_id_cmd);
|
||||||
install_element(OSPF_NODE, &ospf_router_id_old_cmd);
|
install_element(OSPF_NODE, &ospf_router_id_old_cmd);
|
||||||
install_element(OSPF_NODE, &no_ospf_router_id_cmd);
|
install_element(OSPF_NODE, &no_ospf_router_id_cmd);
|
||||||
|
install_element(OSPF_NODE, &no_router_id_cmd);
|
||||||
|
|
||||||
/* "passive-interface" commands. */
|
/* "passive-interface" commands. */
|
||||||
install_element(OSPF_NODE, &ospf_passive_interface_default_cmd);
|
install_element(OSPF_NODE, &ospf_passive_interface_default_cmd);
|
||||||
|
|
|
@ -147,15 +147,10 @@ void ospf_process_refresh_data(struct ospf *ospf, bool reset)
|
||||||
|
|
||||||
/* Select the router ID based on these priorities:
|
/* Select the router ID based on these priorities:
|
||||||
1. Statically assigned router ID is always the first choice.
|
1. Statically assigned router ID is always the first choice.
|
||||||
2. If there is no statically assigned router ID, then try to stick
|
2. Just go with whatever the zebra daemon recommends.
|
||||||
with the most recent value, since changing router ID's is very
|
|
||||||
disruptive.
|
|
||||||
3. Last choice: just go with whatever the zebra daemon recommends.
|
|
||||||
*/
|
*/
|
||||||
if (ospf->router_id_static.s_addr != INADDR_ANY)
|
if (ospf->router_id_static.s_addr != INADDR_ANY)
|
||||||
router_id = ospf->router_id_static;
|
router_id = ospf->router_id_static;
|
||||||
else if (ospf->router_id.s_addr != INADDR_ANY)
|
|
||||||
router_id = ospf->router_id;
|
|
||||||
else
|
else
|
||||||
router_id = ospf->router_id_zebra;
|
router_id = ospf->router_id_zebra;
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue