summaryrefslogtreecommitdiff
path: root/proto/bgp/attrs.c
diff options
context:
space:
mode:
authorMaria Matejka <mq@ucw.cz>2022-07-14 11:09:23 +0200
committerMaria Matejka <mq@ucw.cz>2022-07-14 12:13:18 +0200
commit1c2851ecfa94f3d0b732a267c6c2db8b817c37f4 (patch)
tree82a4121164b1b4063644373a7e3ecd11d88b3896 /proto/bgp/attrs.c
parent239edf8d315f90de23c3ff6c68be77049fa6fa05 (diff)
Fixed invalid routes handling
The invalid routes were filtered out before they could ever get exported, yet some of the routines need them available, e.g. for display or import reload. Now the invalid routes are properly exported and dropped in channel export routines instead.
Diffstat (limited to 'proto/bgp/attrs.c')
-rw-r--r--proto/bgp/attrs.c10
1 files changed, 4 insertions, 6 deletions
diff --git a/proto/bgp/attrs.c b/proto/bgp/attrs.c
index 1ca77fd5..883a9746 100644
--- a/proto/bgp/attrs.c
+++ b/proto/bgp/attrs.c
@@ -2557,12 +2557,10 @@ bgp_rte_modify_stale(struct rt_export_request *req, const net_addr *n, struct rt
{
rte *r = feed[i];
- /* Not our route */
- if (r->sender != irh)
- continue;
-
- /* A new route, do not mark as stale */
- if (r->stale_cycle == irh->stale_set)
+ if (
+ !rte_is_valid(r) || /* Not a valid route */
+ (r->sender != irh) || /* Not our route */
+ (r->stale_cycle == irh->stale_set)) /* A new route, do not mark as stale */
continue;
eattr *ea = ea_find(r->attrs, BGP_EA_ID(BA_COMMUNITY));