summaryrefslogtreecommitdiff
path: root/proto/bgp/packets.c
diff options
context:
space:
mode:
authorOndrej Zajicek (work) <santiago@crfreenet.org>2019-09-28 14:17:20 +0200
committerOndrej Zajicek (work) <santiago@crfreenet.org>2019-10-09 17:53:23 +0200
commit09ee846d9275b4cb0b77f7e458aba6a71b111c52 (patch)
tree21fd5d815e7f7b7dc7d6dd3a473ece834c2d024c /proto/bgp/packets.c
parent759b204be33fa8485c9e28038ee029a49e2e9d3f (diff)
BGP: AIGP metric support (RFC 7311)
Diffstat (limited to 'proto/bgp/packets.c')
-rw-r--r--proto/bgp/packets.c3
1 files changed, 3 insertions, 0 deletions
diff --git a/proto/bgp/packets.c b/proto/bgp/packets.c
index 4632e4ad..c3bd600a 100644
--- a/proto/bgp/packets.c
+++ b/proto/bgp/packets.c
@@ -919,6 +919,7 @@ bgp_apply_next_hop(struct bgp_parse_state *s, rta *a, ip_addr gw, ip_addr ll)
a->dest = RTD_UNICAST;
a->nh.gw = nbr->addr;
a->nh.iface = nbr->iface;
+ a->igp_metric = c->cf->cost;
}
else /* GW_RECURSIVE */
{
@@ -1063,6 +1064,7 @@ bgp_update_next_hop_ip(struct bgp_export_state *s, eattr *a, ea_list **to)
{
ip_addr nh[2] = { s->channel->next_hop_addr, s->channel->link_addr };
bgp_set_attr_data(to, s->pool, BA_NEXT_HOP, 0, nh, ipa_nonzero(nh[1]) ? 32 : 16);
+ s->local_next_hop = 1;
/* TODO: Use local MPLS assigned label */
if (s->mpls)
@@ -2401,6 +2403,7 @@ bgp_decode_nlri(struct bgp_parse_state *s, u32 afi, byte *nlri, uint len, ea_lis
a->eattrs = ea;
c->desc->decode_next_hop(s, nh, nh_len, a);
+ bgp_finish_attrs(s, a);
/* Handle withdraw during next hop decoding */
if (s->err_withdraw)