Skip to content

Commit

Permalink
ospfd: Use router_id what Zebra has if we remove a static router_id
Browse files Browse the repository at this point in the history
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 <[email protected]>
  • Loading branch information
ton31337 committed Oct 31, 2024
1 parent 80bfe67 commit 1073e0f
Showing 1 changed file with 1 addition and 6 deletions.
7 changes: 1 addition & 6 deletions ospfd/ospfd.c
Original file line number Diff line number Diff line change
Expand Up @@ -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;

Expand Down

0 comments on commit 1073e0f

Please sign in to comment.