diff options
author | Ondrej Zajicek (work) <santiago@crfreenet.org> | 2022-01-24 03:44:21 +0100 |
---|---|---|
committer | Ondrej Zajicek (work) <santiago@crfreenet.org> | 2022-01-24 03:44:21 +0100 |
commit | 9dbb7eb6ebda016cd14ce8fef403c2b3f7bdd504 (patch) | |
tree | 62121fe6ef0706322353bb26525fc1199a74afe2 /proto/bgp/attrs.c | |
parent | a9646efd40569f3a1d749bc1bd13219876b33a00 (diff) |
BGP: Log route updates that were changed to withdraws
Typical BGP error handling is treat-as-withdraw, where an invalid route
is replaced with a withdraw. Log route network when it happens.
Diffstat (limited to 'proto/bgp/attrs.c')
-rw-r--r-- | proto/bgp/attrs.c | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/proto/bgp/attrs.c b/proto/bgp/attrs.c index 24ba00ba..0688c7cd 100644 --- a/proto/bgp/attrs.c +++ b/proto/bgp/attrs.c @@ -1845,6 +1845,10 @@ bgp_rt_notify(struct proto *P, struct channel *C, net *n, rte *new, rte *old) { struct ea_list *attrs = bgp_update_attrs(p, c, new, new->attrs->eattrs, bgp_linpool2); + /* Error during attribute processing */ + if (!attrs) + log(L_ERR "%s: Invalid route %N withdrawn", p->p.name, n->n.addr); + /* If attributes are invalid, we fail back to withdraw */ buck = attrs ? bgp_get_bucket(c, attrs) : bgp_get_withdraw_bucket(c); path = new->attrs->src->global_id; |