summaryrefslogtreecommitdiffstats
path: root/ospfd/ospfd.c
diff options
context:
space:
mode:
authorajs <ajs>2006-07-27 22:29:06 +0000
committerajs <ajs>2006-07-27 22:29:06 +0000
commitb928a6f5898b67ddcc56aec9fb78935828908558 (patch)
treecdd9cf7d4a36b6e45c977f63703a06473be96894 /ospfd/ospfd.c
parent6ccd3dcd4319ce6028950f0889689fc45eadcc63 (diff)
downloadquagga-b928a6f5898b67ddcc56aec9fb78935828908558.tar.bz2
quagga-b928a6f5898b67ddcc56aec9fb78935828908558.tar.xz
[ospfd] Bug #288: do not change router ID unless forced by manual configuration
2006-07-27 Andrew J. Schorr <ajschorr@alumni.princeton.edu> * ospfd.c: (ospf_router_id_update) Fix and document the algorithm for selecting the router ID: if there is not a statically configured ID, then stick to the most recent value to avoid disruptive changes. This should fix bug #288.
Diffstat (limited to 'ospfd/ospfd.c')
-rw-r--r--ospfd/ospfd.c9
1 files changed, 9 insertions, 0 deletions
diff --git a/ospfd/ospfd.c b/ospfd/ospfd.c
index ef8272b0..95615e4a 100644
--- a/ospfd/ospfd.c
+++ b/ospfd/ospfd.c
@@ -84,8 +84,17 @@ ospf_router_id_update (struct ospf *ospf)
router_id_old = ospf->router_id;
+ /* 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.
+ */
if (ospf->router_id_static.s_addr != 0)
router_id = ospf->router_id_static;
+ else if (ospf->router_id.s_addr != 0)
+ router_id = ospf->router_id;
else
router_id = router_id_zebra;