mirror of
https://git.proxmox.com/git/mirror_frr
synced 2025-06-06 11:04:41 +00:00
bgp: Add a 15 minute warning to missing policy
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 b17826b715
)
This commit is contained in:
parent
c432b3c775
commit
aeb1da0ca2
@ -2219,8 +2219,16 @@ bool subgroup_announce_check(struct bgp_dest *dest, struct bgp_path_info *pi,
|
|||||||
* implementations.
|
* implementations.
|
||||||
*/
|
*/
|
||||||
if (CHECK_FLAG(bgp->flags, BGP_FLAG_EBGP_REQUIRES_POLICY))
|
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;
|
return false;
|
||||||
|
}
|
||||||
|
|
||||||
/* draft-ietf-idr-deprecate-as-set-confed-set
|
/* draft-ietf-idr-deprecate-as-set-confed-set
|
||||||
* Filter routes having AS_SET or AS_CONFED_SET in the path.
|
* 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,
|
if (!bgp_inbound_policy_exists(peer,
|
||||||
&peer->filter[afi][safi])) {
|
&peer->filter[afi][safi])) {
|
||||||
reason = "inbound policy missing";
|
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;
|
goto filtered;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -3239,6 +3239,10 @@ static struct bgp *bgp_create(as_t *as, const char *name,
|
|||||||
|
|
||||||
/*initilize global GR FSM */
|
/*initilize global GR FSM */
|
||||||
bgp_global_gr_init(bgp);
|
bgp_global_gr_init(bgp);
|
||||||
|
|
||||||
|
memset(&bgp->ebgprequirespolicywarning, 0,
|
||||||
|
sizeof(bgp->ebgprequirespolicywarning));
|
||||||
|
|
||||||
return bgp;
|
return bgp;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -759,6 +759,9 @@ struct bgp {
|
|||||||
struct list *srv6_locator_chunks;
|
struct list *srv6_locator_chunks;
|
||||||
struct list *srv6_functions;
|
struct list *srv6_functions;
|
||||||
|
|
||||||
|
struct timeval ebgprequirespolicywarning;
|
||||||
|
#define FIFTEENMINUTE2USEC (int64_t)15 * 60 * 1000000
|
||||||
|
|
||||||
QOBJ_FIELDS;
|
QOBJ_FIELDS;
|
||||||
};
|
};
|
||||||
DECLARE_QOBJ_TYPE(bgp);
|
DECLARE_QOBJ_TYPE(bgp);
|
||||||
|
Loading…
Reference in New Issue
Block a user