]> git.puffer.fish Git - mirror/frr.git/commitdiff
bgp: Add a 15 minute warning to missing policy 10607/head
authorDonald Sharp <sharpd@nvidia.com>
Mon, 14 Feb 2022 12:57:45 +0000 (07:57 -0500)
committermergify-bot <noreply@mergify.com>
Thu, 17 Feb 2022 16:01:25 +0000 (16:01 +0000)
Add a 15 minute warning to the logging system when
bgp policy is not setup properly.  Operators keep asking
about the missing policy( on upgrade typically ).  Let's
try to give them a bit more of a hint when something is
going wrong as that they are clearly missing the other
various places FRR tells them about it.

Signed-off-by: Donald Sharp <sharpd@nvidia.com>
(cherry picked from commit b17826b715996558df93ae52e281c10c8925fdce)

bgpd/bgp_route.c
bgpd/bgpd.c
bgpd/bgpd.h

index 4864089f8a5dd576946a08fd35b2e1bba1a37825..50c147c5c480e484dddee5a2cbdb000d50169fcf 100644 (file)
@@ -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.
@@ -3841,6 +3849,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;
                }
 
index e6d4000ad8f632683bb26dd81918a4308a047928..567b049c1b831578e41c8acc35d0176da13c3d59 100644 (file)
@@ -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;
 }
 
index ae6427b356641f5f8ad3fd4d3fdfb793c46833b0..ff295ffa27525d1bffe27cd89534457eca6b2279 100644 (file)
@@ -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);