Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 1 addition & 3 deletions daemon/src/event.rs
Original file line number Diff line number Diff line change
Expand Up @@ -4481,9 +4481,7 @@ impl PeerSession {
crate::fsm::SessionDownReason::RemoteNotification(msg) => {
bmp::PeerDownReason::RemoteNotification(msg)
}
crate::fsm::SessionDownReason::FsmError(_) => {
bmp::PeerDownReason::LocalFsm(0)
}
crate::fsm::SessionDownReason::FsmError => bmp::PeerDownReason::LocalFsm(0),
crate::fsm::SessionDownReason::AdminShutdown => {
bmp::PeerDownReason::LocalFsm(0)
}
Expand Down
17 changes: 8 additions & 9 deletions daemon/src/fsm.rs
Original file line number Diff line number Diff line change
Expand Up @@ -114,11 +114,10 @@ pub(crate) enum Output {

/// Reason the session is going down.
#[derive(Clone)]
#[allow(dead_code)]
pub(crate) enum SessionDownReason {
HoldTimerExpired,
RemoteNotification(bgp::Message),
FsmError(State),
FsmError,
AdminShutdown,
IoError,
}
Expand Down Expand Up @@ -240,7 +239,7 @@ impl Connection {
state: u8::from(self.state),
},
)),
Output::SessionDown(SessionDownReason::FsmError(self.state)),
Output::SessionDown(SessionDownReason::FsmError),
];
}

Expand Down Expand Up @@ -317,7 +316,7 @@ impl Connection {
state: u8::from(self.state),
},
)),
Output::SessionDown(SessionDownReason::FsmError(self.state)),
Output::SessionDown(SessionDownReason::FsmError),
],
}
}
Expand All @@ -330,7 +329,7 @@ impl Connection {
state: u8::from(self.state),
},
)),
Output::SessionDown(SessionDownReason::FsmError(self.state)),
Output::SessionDown(SessionDownReason::FsmError),
];
}
vec![Output::SetHoldTimer(self.negotiated_holdtime)]
Expand All @@ -350,7 +349,7 @@ impl Connection {
state: u8::from(self.state),
},
)),
Output::SessionDown(SessionDownReason::FsmError(self.state)),
Output::SessionDown(SessionDownReason::FsmError),
];
}
vec![Output::RouteRefresh(family)]
Expand Down Expand Up @@ -750,7 +749,7 @@ mod tests {
)));
assert!(has_output(&out, |o| matches!(
o,
Output::SessionDown(SessionDownReason::FsmError(_))
Output::SessionDown(SessionDownReason::FsmError)
)));
}

Expand Down Expand Up @@ -952,7 +951,7 @@ mod tests {
)));
assert!(has_output(&out, |o| matches!(
o,
Output::SessionDown(SessionDownReason::FsmError(_))
Output::SessionDown(SessionDownReason::FsmError)
)));
}

Expand Down Expand Up @@ -992,7 +991,7 @@ mod tests {
)));
assert!(has_output(&out, |o| matches!(
o,
Output::SessionDown(SessionDownReason::FsmError(_))
Output::SessionDown(SessionDownReason::FsmError)
)));
}

Expand Down
Loading