summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDonatas Abraitis <donatas@opensourcerouting.org>2024-10-31 11:38:40 +0200
committerMergify <37929162+mergify[bot]@users.noreply.github.com>2024-11-05 15:21:04 +0000
commita5fe2ec138385098f9ecc70349d170ce80428937 (patch)
treea91ff0fb67a768ba086ec410c842ecfbf9acdaf0
parent45a9295d87b71c3e3a0d7694333cef88cc64bafc (diff)
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> (cherry picked from commit 1073e0f9b39b2810a114dea03f2d1e0b14e414d4)
-rw-r--r--ospfd/ospfd.c7
1 files changed, 1 insertions, 6 deletions
diff --git a/ospfd/ospfd.c b/ospfd/ospfd.c
index 4c4666db52..411f3a0440 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;