diff options
Diffstat (limited to 'proto/bgp/packets.c')
-rw-r--r-- | proto/bgp/packets.c | 41 |
1 files changed, 7 insertions, 34 deletions
diff --git a/proto/bgp/packets.c b/proto/bgp/packets.c index e72ec222..45ee4ed2 100644 --- a/proto/bgp/packets.c +++ b/proto/bgp/packets.c @@ -1033,27 +1033,6 @@ bgp_apply_mpls_labels(struct bgp_parse_state *s, ea_list **to, u32 lnum, u32 lab } } -static void -bgp_apply_flow_validation(struct bgp_parse_state *s, const net_addr *n, ea_list **to) -{ - struct bgp_channel *c = s->channel; - uint valid = rt_flowspec_check(c->base_table, c->c.table, n, *to, s->proto->is_interior); - - /* Invalidate cached rta */ - if (s->cached_ea) - { - /* Has't changed */ - if (valid == ea_get_int(s->cached_ea, &ea_gen_flowspec_valid, FLOWSPEC_UNKNOWN)) - return; - - rta_free(s->cached_ea); - s->cached_ea = NULL; - } - - /* Set the value */ - ea_set_attr_u32(to, &ea_gen_flowspec_valid, 0, valid); -} - static int bgp_match_src(struct bgp_export_state *s, int mode) { @@ -1407,7 +1386,7 @@ bgp_rte_update(struct bgp_parse_state *s, const net_addr *n, u32 path_id, ea_lis REPORT("Invalid route %N withdrawn", n); /* Route withdraw */ - rte_update3(&s->channel->c, n, NULL, s->last_src); + rte_update(&s->channel->c, n, NULL, s->last_src); return; } @@ -1415,10 +1394,12 @@ bgp_rte_update(struct bgp_parse_state *s, const net_addr *n, u32 path_id, ea_lis if (s->cached_ea == NULL) s->cached_ea = ea_lookup(a0); - rte *e = rte_get_temp(rta_clone(s->cached_ea), s->last_src); + rte e0 = { + .attrs = s->cached_ea, + .src = s->last_src, + }; - e->pflags = 0; - rte_update3(&s->channel->c, n, e, s->last_src); + rte_update(&s->channel->c, n, &e0, s->last_src); } static void @@ -1922,10 +1903,6 @@ bgp_decode_nlri_flow4(struct bgp_parse_state *s, byte *pos, uint len, ea_list *a net_fill_flow4(n, px, pxlen, pos, flen); ADVANCE(pos, len, flen); - /* Apply validation procedure per RFC 8955 (6) */ - if (a && s->channel->cf->validate) - bgp_apply_flow_validation(s, n, &a); - bgp_rte_update(s, n, path_id, a); } } @@ -2014,10 +1991,6 @@ bgp_decode_nlri_flow6(struct bgp_parse_state *s, byte *pos, uint len, ea_list *a net_fill_flow6(n, px, pxlen, pos, flen); ADVANCE(pos, len, flen); - /* Apply validation procedure per RFC 8955 (6) */ - if (a && s->channel->cf->validate) - bgp_apply_flow_validation(s, n, &a); - bgp_rte_update(s, n, path_id, a); } } @@ -2751,7 +2724,7 @@ bgp_rx_route_refresh(struct bgp_conn *conn, byte *pkt, uint len) { case BGP_RR_REQUEST: BGP_TRACE(D_PACKETS, "Got ROUTE-REFRESH"); - channel_request_feeding(&c->c); + rt_refeed_channel(&c->c); break; case BGP_RR_BEGIN: |