Skip to content

Commit 2601c76

Browse files
committed
ospfv3: fix: re-elect the DR promptly when the DR's adjacency dies of inactivity
When a Full neighbor's inactivity timer fires, OSPFv2 additionally checks whether the dead neighbor was the Designated Router while this router is the Backup: if so, it fires NEIGHBOR_CHANGE on the interface so DR re-election happens immediately rather than on some later Hello. The OSPFv3 port lacked this step; mirror it. All 11 ospfv3 + BgpAndOspfv3 fingerprints are byte-identical: in the shipped examples adjacency teardown is signal-driven (interface down kills neighbors directly), so the inactivity timer never expires on a Full DR adjacency. The step matters for silent failures (a DR that stops sending Hellos without a carrier loss).
1 parent 7b02d8d commit 2601c76

1 file changed

Lines changed: 8 additions & 0 deletions

File tree

src/inet/routing/ospfv3/neighbor/Ospfv3NeighborStateFull.cc

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -34,6 +34,14 @@ void Ospfv3NeighborStateFull::processEvent(Ospfv3Neighbor *neighbor, Ospfv3Neigh
3434
neighbor->getInterface()->getArea()->getInstance()->getProcess()->setTimer(neighbor->getPollTimer(), neighbor->getInterface()->getPollInterval());
3535

3636
changeState(neighbor, new Ospfv3NeighborStateDown, this);
37+
38+
// the dead neighbor was the DR and this router is the BDR: re-run the DR election
39+
// promptly instead of waiting for the next Hello (mirrors OSPFv2)
40+
if (neighbor->getInterface()->getState() == Ospfv3Interface::INTERFACE_STATE_BACKUP &&
41+
neighbor->getInterface()->getDesignatedID() == neighbor->getNeighborID())
42+
{
43+
neighbor->getInterface()->processEvent(Ospfv3Interface::NEIGHBOR_CHANGE_EVENT);
44+
}
3745
}
3846
else if (event == Ospfv3Neighbor::ONEWAY_RECEIVED) {
3947
neighbor->reset();

0 commit comments

Comments
 (0)