From 1c30b689ddd032ef8000fb7836348a48ba3184ff Mon Sep 17 00:00:00 2001 From: Maria Matejka Date: Wed, 4 May 2022 14:41:51 +0200 Subject: Moved route source attribute (RTS_*) to eattrs --- proto/bgp/attrs.c | 2 +- proto/bgp/config.Y | 2 +- proto/bgp/packets.c | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) (limited to 'proto/bgp') diff --git a/proto/bgp/attrs.c b/proto/bgp/attrs.c index 097ba9a2..1efc26ce 100644 --- a/proto/bgp/attrs.c +++ b/proto/bgp/attrs.c @@ -402,7 +402,7 @@ bgp_total_aigp_metric_(rte *e, u64 *metric, const struct adata **ad) static inline int bgp_init_aigp_metric(rte *e, u64 *metric, const struct adata **ad) { - if (e->attrs->source == RTS_BGP) + if (rt_get_source_attr(e) == RTS_BGP) return 0; *metric = rt_get_igp_metric(e); diff --git a/proto/bgp/config.Y b/proto/bgp/config.Y index b4d8b83f..24f3ec8f 100644 --- a/proto/bgp/config.Y +++ b/proto/bgp/config.Y @@ -43,7 +43,7 @@ CF_KEYWORDS(CEASE, PREFIX, LIMIT, HIT, ADMINISTRATIVE, SHUTDOWN, RESET, PEER, CF_GRAMMAR -toksym: BGP_MED | BGP_LOCAL_PREF ; +toksym: BGP_MED | BGP_LOCAL_PREF | SOURCE ; proto: bgp_proto '}' ; diff --git a/proto/bgp/packets.c b/proto/bgp/packets.c index 62d60e9a..0aa4dc40 100644 --- a/proto/bgp/packets.c +++ b/proto/bgp/packets.c @@ -2474,11 +2474,11 @@ bgp_decode_nlri(struct bgp_parse_state *s, u32 afi, byte *nlri, uint len, ea_lis { a = allocz(RTA_MAX_SIZE); - a->source = RTS_BGP; a->eattrs = ea; ea_set_attr_data(&a->eattrs, &ea_gen_from, 0, &s->proto->remote_ip, sizeof(ip_addr)); ea_set_attr_u32(&a->eattrs, &ea_gen_preference, 0, c->c.preference); + ea_set_attr_u32(&a->eattrs, &ea_gen_source, 0, RTS_BGP); c->desc->decode_next_hop(s, nh, nh_len, a); bgp_finish_attrs(s, a); -- cgit v1.2.3