File tree Expand file tree Collapse file tree 1 file changed +9
-4
lines changed
Expand file tree Collapse file tree 1 file changed +9
-4
lines changed Original file line number Diff line number Diff line change 11use crate :: bgp:: parse_bgp_message;
2+ use crate :: models:: capabilities:: BgpCapabilityType ;
23use crate :: models:: * ;
34use crate :: parser:: bmp:: error:: ParserBmpError ;
45use crate :: parser:: bmp:: messages:: BmpPeerType ;
@@ -83,10 +84,14 @@ pub fn parse_peer_up_notification(
8384 if let Some ( BmpPeerType :: LocalRib ) = peer_type {
8485 // Validate that the OPEN messages contain appropriate capabilities for Local RIB
8586 if let BgpMessage :: Open ( ref open_msg) = & sent_open {
86- let has_multiprotocol_capability = open_msg
87- . opt_params
88- . iter ( )
89- . any ( |param| matches ! ( param. param_value, ParamValue :: Capacities ( _) ) ) ;
87+ let has_multiprotocol_capability = open_msg. opt_params . iter ( ) . any ( |param| {
88+ if let ParamValue :: Capacities ( caps) = & param. param_value {
89+ caps. iter ( )
90+ . any ( |cap| cap. ty == BgpCapabilityType :: MULTIPROTOCOL_EXTENSIONS_FOR_BGP_4 )
91+ } else {
92+ false
93+ }
94+ } ) ;
9095 if !has_multiprotocol_capability {
9196 warn ! ( "RFC 9069: Local RIB peer up notification should include multiprotocol capabilities in fabricated OPEN messages" ) ;
9297 }
You can’t perform that action at this time.
0 commit comments