From 51e9a7bd18888199c9773c6d81799686e3d52196 Mon Sep 17 00:00:00 2001 From: Eugene Bogomazov Date: Tue, 14 Jun 2022 12:17:45 +0300 Subject: [PATCH 3/3] [PATCH] Remove ROLE MAX and update config option --- proto/bgp/bgp.h | 1 - proto/bgp/config.Y | 2 +- proto/bgp/packets.c | 1 - 3 files changed, 1 insertion(+), 3 deletions(-) diff --git a/proto/bgp/bgp.h b/proto/bgp/bgp.h index e525973b..d27e3ab2 100644 --- a/proto/bgp/bgp.h +++ b/proto/bgp/bgp.h @@ -175,7 +175,6 @@ struct bgp_channel_config { #define BGP_ROLE_RS_CLIENT 2 #define BGP_ROLE_CUSTOMER 3 #define BGP_ROLE_PEER 4 -#define BGP_ROLE_MAX 5 #define MLL_SELF 1 #define MLL_DROP 2 diff --git a/proto/bgp/config.Y b/proto/bgp/config.Y index cd6cb8cd..8a8152c8 100644 --- a/proto/bgp/config.Y +++ b/proto/bgp/config.Y @@ -209,7 +209,7 @@ bgp_proto: | bgp_proto BFD { open_bfd_opts(&BGP_CFG->bfd); } bfd_opts { close_bfd_opts(); } ';' | bgp_proto ENFORCE FIRST AS bool ';' { BGP_CFG->enforce_first_as = $5; } | bgp_proto LOCAL ROLE bgp_role_name ';' { BGP_CFG->local_role = $4; } - | bgp_proto STRICT MODE ';' { BGP_CFG->strict_mode = 1; } + | bgp_proto STRICT MODE bool ';' { BGP_CFG->strict_mode = $4; } ; bgp_afi: diff --git a/proto/bgp/packets.c b/proto/bgp/packets.c index 1187f359..c403d85c 100644 --- a/proto/bgp/packets.c +++ b/proto/bgp/packets.c @@ -884,7 +884,6 @@ bgp_rx_open(struct bgp_conn *conn, byte *pkt, uint len) u8 local_role = p->cf->local_role; if ((neigh_role != BGP_ROLE_UNDEFINED) && - (neigh_role < BGP_ROLE_MAX) && (local_role != BGP_ROLE_UNDEFINED) && !( (local_role == BGP_ROLE_CUSTOMER && neigh_role == BGP_ROLE_PROVIDER) || (local_role == BGP_ROLE_PROVIDER && neigh_role == BGP_ROLE_CUSTOMER) || -- 2.25.1