--- embedaddon/bird/proto/pipe/pipe.c 2017/08/22 12:33:54 1.1.1.1 +++ embedaddon/bird/proto/pipe/pipe.c 2021/03/17 19:50:23 1.1.1.2 @@ -89,6 +89,12 @@ pipe_rt_notify(struct proto *P, rtable *src_table, net memcpy(&(e->u), &(new->u), sizeof(e->u)); e->pref = new->pref; e->pflags = new->pflags; + +#ifdef CONFIG_BGP + /* Hack to cleanup cached value */ + if (e->attrs->src->proto->proto == &proto_bgp) + e->u.bgp.stale = -1; +#endif } src = a.src; @@ -230,12 +236,18 @@ pipe_reconfigure(struct proto *P, struct proto_config if ((oc->peer->table != nc->peer->table) || (oc->mode != nc->mode)) return 0; + int import_changed = ! filter_same(new->in_filter, old->in_filter); + int export_changed = ! filter_same(new->out_filter, old->out_filter); + /* Update output filters in ahooks */ if (P->main_ahook) { P->main_ahook->out_filter = new->out_filter; P->main_ahook->in_limit = new->in_limit; proto_verify_limits(P->main_ahook); + + if (export_changed) + P->main_ahook->last_out_filter_change = now; } if (p->peer_ahook) @@ -243,14 +255,15 @@ pipe_reconfigure(struct proto *P, struct proto_config p->peer_ahook->out_filter = new->in_filter; p->peer_ahook->in_limit = new->out_limit; proto_verify_limits(p->peer_ahook); + + if (import_changed) + p->peer_ahook->last_out_filter_change = now; } if ((P->proto_state != PS_UP) || (proto_reconfig_type == RECONFIG_SOFT)) return 1; - if ((new->preference != old->preference) - || ! filter_same(new->in_filter, old->in_filter) - || ! filter_same(new->out_filter, old->out_filter)) + if (import_changed || export_changed || (new->preference != old->preference)) proto_request_feeding(P); return 1;