Skip to content

Commit 047398b

Browse files
authored
Merge pull request holo-routing#157 from gusbourg/vrrp-initialize-advertisement
vrrp: ignore advertisements received in the Initialize state
2 parents c52e1aa + d304815 commit 047398b

1 file changed

Lines changed: 6 additions & 3 deletions

File tree

holo-vrrp/src/events.rs

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -95,9 +95,12 @@ pub(crate) fn process_vrrp_packet(
9595

9696
// RFC 3768: Section 6.4.2 ("If an ADVERTISEMENT is received")
9797
match instance.state.state {
98-
fsm::State::Initialize => {
99-
unreachable!()
100-
}
98+
// An advertisement can still be delivered while the router is in the
99+
// Initialize state: the receive task may have enqueued the packet just
100+
// before the instance was shut down and transitioned back to
101+
// Initialize. Ignore it rather than treating it as unreachable, which
102+
// would panic the process.
103+
fsm::State::Initialize => {}
101104
fsm::State::Backup => {
102105
if packet.priority == 0 {
103106
let duration =

0 commit comments

Comments
 (0)