summaryrefslogtreecommitdiff
path: root/proto/bgp/bgp.c
diff options
context:
space:
mode:
authorOndrej Zajicek <santiago@crfreenet.org>2022-07-12 15:03:17 +0200
committerOndrej Zajicek <santiago@crfreenet.org>2022-07-12 15:03:17 +0200
commit971721c9b50d361e886762f1c7d0392e10f74021 (patch)
tree89063aca980d745fbf2c0916263ac1a29c210219 /proto/bgp/bgp.c
parentc73b5d2d3d94204d2a81d93efd02c4c115859353 (diff)
BGP: Minor improvements to BGP roles
Add support for bgp_otc in filters and warning for configuration inside confederations.
Diffstat (limited to 'proto/bgp/bgp.c')
-rw-r--r--proto/bgp/bgp.c5
1 files changed, 4 insertions, 1 deletions
diff --git a/proto/bgp/bgp.c b/proto/bgp/bgp.c
index 3b28a338..0f06746f 100644
--- a/proto/bgp/bgp.c
+++ b/proto/bgp/bgp.c
@@ -1987,6 +1987,9 @@ bgp_postconfig(struct proto_config *CF)
if (internal && (cf->local_role != BGP_ROLE_UNDEFINED))
cf_error("Local role cannot be set on IBGP sessions");
+ if (interior && (cf->local_role != BGP_ROLE_UNDEFINED))
+ log(L_WARN "BGP roles are not recommended to be used within AS confederations");
+
if (cf->require_roles && (cf->local_role == BGP_ROLE_UNDEFINED))
cf_error("Local role must be set if roles are required");
@@ -2357,7 +2360,7 @@ bgp_format_role_name(u8 role)
{
static const char *bgp_role_names[] = { "provider", "rs_server", "rs_client", "customer", "peer" };
if (role == BGP_ROLE_UNDEFINED) return "undefined";
- if (role < 5) return bgp_role_names[role];
+ if (role < ARRAY_SIZE(bgp_role_names)) return bgp_role_names[role];
return "?";
}