summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorRuss White <russ@riw.us>2022-02-15 21:33:16 -0500
committerGitHub <noreply@github.com>2022-02-15 21:33:16 -0500
commitfbd44411eec0ea928ea99f7fb4b67f078662404b (patch)
treefaf94c0d4ee430abcb652574c69a731cc77ea618
parentc07cfc54940c2dce071f5173f0b719592419b2d2 (diff)
parentb17826b715996558df93ae52e281c10c8925fdce (diff)
Merge pull request #10575 from donaldsharp/bgp_requires_policy
bgp: Add a 6 hour warning to missing policy
-rw-r--r--bgpd/bgp_route.c17
-rw-r--r--bgpd/bgpd.c4
-rw-r--r--bgpd/bgpd.h3
3 files changed, 23 insertions, 1 deletions
diff --git a/bgpd/bgp_route.c b/bgpd/bgp_route.c
index 66c5d862a6..8311cb207c 100644
--- a/bgpd/bgp_route.c
+++ b/bgpd/bgp_route.c
@@ -2219,8 +2219,16 @@ bool subgroup_announce_check(struct bgp_dest *dest, struct bgp_path_info *pi,
* implementations.
*/
if (CHECK_FLAG(bgp->flags, BGP_FLAG_EBGP_REQUIRES_POLICY))
- if (!bgp_outbound_policy_exists(peer, filter))
+ if (!bgp_outbound_policy_exists(peer, filter)) {
+ if (monotime_since(&bgp->ebgprequirespolicywarning,
+ NULL) > FIFTEENMINUTE2USEC ||
+ bgp->ebgprequirespolicywarning.tv_sec == 0) {
+ zlog_warn(
+ "EBGP inbound/outbound policy not properly setup, please configure in order for your peering to work correctly");
+ monotime(&bgp->ebgprequirespolicywarning);
+ }
return false;
+ }
/* draft-ietf-idr-deprecate-as-set-confed-set
* Filter routes having AS_SET or AS_CONFED_SET in the path.
@@ -3844,6 +3852,13 @@ int bgp_update(struct peer *peer, const struct prefix *p, uint32_t addpath_id,
if (!bgp_inbound_policy_exists(peer,
&peer->filter[afi][safi])) {
reason = "inbound policy missing";
+ if (monotime_since(&bgp->ebgprequirespolicywarning,
+ NULL) > FIFTEENMINUTE2USEC ||
+ bgp->ebgprequirespolicywarning.tv_sec == 0) {
+ zlog_warn(
+ "EBGP inbound/outbound policy not properly setup, please configure in order for your peering to work correctly");
+ monotime(&bgp->ebgprequirespolicywarning);
+ }
goto filtered;
}
diff --git a/bgpd/bgpd.c b/bgpd/bgpd.c
index e6d4000ad8..567b049c1b 100644
--- a/bgpd/bgpd.c
+++ b/bgpd/bgpd.c
@@ -3239,6 +3239,10 @@ static struct bgp *bgp_create(as_t *as, const char *name,
/*initilize global GR FSM */
bgp_global_gr_init(bgp);
+
+ memset(&bgp->ebgprequirespolicywarning, 0,
+ sizeof(bgp->ebgprequirespolicywarning));
+
return bgp;
}
diff --git a/bgpd/bgpd.h b/bgpd/bgpd.h
index ae6427b356..ff295ffa27 100644
--- a/bgpd/bgpd.h
+++ b/bgpd/bgpd.h
@@ -759,6 +759,9 @@ struct bgp {
struct list *srv6_locator_chunks;
struct list *srv6_functions;
+ struct timeval ebgprequirespolicywarning;
+#define FIFTEENMINUTE2USEC (int64_t)15 * 60 * 1000000
+
QOBJ_FIELDS;
};
DECLARE_QOBJ_TYPE(bgp);