mirror of
https://git.proxmox.com/git/mirror_frr
synced 2025-08-09 07:56:29 +00:00
ospfd: Use router_id what Zebra has if we remove a static router_id
If we set router-id, e.g. `router-id x.x.x.x`, then we have: ``` pc.donatas.net# show ip ospf | include Router ID OSPF Routing Process, Router ID: x.x.x.x ``` But once we remove it (`no router-id x.x.x.x`), the old router-id remains. This is kinda OK, but to be consistent with OSPFv3 we should use what Zebra already has, instead of retaining the old one. Signed-off-by: Donatas Abraitis <donatas@opensourcerouting.org>
This commit is contained in:
parent
80bfe6784f
commit
1073e0f9b3
@ -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 New Issue
Block a user