Skip to content

Commit 7b02d8d

Browse files
committed
ospfv3: fix: dispatch the BackupSeen event computed from received Hellos
processHelloPacket correctly computed backupSeen per RFC 2328 Section 9.5 -- the neighbor declares itself Backup Designated Router, or declares itself Designated Router with no Backup, while this interface is in Waiting -- but then discarded the flag ((void)backupSeen). A router joining a broadcast segment with an already-established DR therefore always sat out the full 40s wait timer instead of ending Waiting immediately. Dispatch BACKUP_SEEN_EVENT to the interface FSM like OSPFv2's HelloHandler does. All 11 ospfv3 + BgpAndOspfv3 fingerprints are byte-identical: in the shipped examples all routers start synchronized, so every interface leaves Waiting via the wait timer before any DR is established, and the reconnect scenarios rejoin two-router segments whose DR state was reset. The event matters for staggered starts (startupTime) and for routers joining live segments.
1 parent 8cee85c commit 7b02d8d

1 file changed

Lines changed: 5 additions & 1 deletion

File tree

src/inet/routing/ospfv3/interface/Ospfv3Interface.cc

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -304,7 +304,6 @@ void Ospfv3Interface::processHelloPacket(Packet *packet)
304304
const auto& hello = packet->peekAtFront<Ospfv3HelloPacket>();
305305
bool neighborChanged = false;
306306
bool backupSeen = false;
307-
(void)backupSeen; // FIXME set but not used variable
308307
bool neighborsDRStateChanged = false;
309308
bool drChanged = false;
310309
bool shouldRebuildRoutingTable = false;
@@ -525,6 +524,11 @@ void Ospfv3Interface::processHelloPacket(Packet *packet)
525524
neighbor->processEvent(Ospfv3Neighbor::ONEWAY_RECEIVED);
526525
}
527526

527+
if (backupSeen) {
528+
EV_DEBUG << "Backup Designated Router seen in Hello packet\n";
529+
this->processEvent(Ospfv3InterfaceEvent::BACKUP_SEEN_EVENT);
530+
}
531+
528532
if (neighborChanged) {
529533
EV_DEBUG << "Neighbor change noted in Hello packet\n";
530534
this->processEvent(Ospfv3InterfaceEvent::NEIGHBOR_CHANGE_EVENT);

0 commit comments

Comments
 (0)