summaryrefslogtreecommitdiffstats
path: root/bgpd/bgp_nht.c
diff options
context:
space:
mode:
authorDon Slice <dslice@cumulusnetworks.com>2017-03-09 15:54:20 +0100
committerDonald Sharp <sharpd@cumulusnetworks.com>2017-04-06 16:32:07 +0200
commitcd1964ff38bdbd2b5d36d0a0d89890e9d1bb2a50 (patch)
tree204d8be9bf9c213e4a895b1d335fafc8cc4c7d3f /bgpd/bgp_nht.c
parentbgpd: labeled unicast config (diff)
downloadfrr-cd1964ff38bdbd2b5d36d0a0d89890e9d1bb2a50.tar.xz
frr-cd1964ff38bdbd2b5d36d0a0d89890e9d1bb2a50.zip
bgpd: labeled unicast processing
Implement support for negotiating IPv4 or IPv6 labeled-unicast address family, exchanging prefixes and installing them in the routing table, as well as interactions with Zebra for FEC registration. This is the implementation of RFC 3107. Signed-off-by: Don Slice <dslice@cumulusnetworks.com>
Diffstat (limited to 'bgpd/bgp_nht.c')
-rw-r--r--bgpd/bgp_nht.c18
1 files changed, 11 insertions, 7 deletions
diff --git a/bgpd/bgp_nht.c b/bgpd/bgp_nht.c
index b0362b553..1e8dc5d97 100644
--- a/bgpd/bgp_nht.c
+++ b/bgpd/bgp_nht.c
@@ -404,8 +404,9 @@ bgp_parse_nexthop_update (int command, vrf_id_t vrf_id)
{
char buf[PREFIX2STR_BUFFER];
prefix2str(&p, buf, sizeof (buf));
- zlog_debug("%d: NH update for %s - metric %d (cur %d) #nhops %d (cur %d)",
- vrf_id, buf, metric, bnc->metric, nexthop_num, bnc->nexthop_num);
+ zlog_debug("%d: Rcvd NH update %s - metric %d/%d #nhops %d/%d flags 0x%x",
+ vrf_id, buf, metric, bnc->metric, nexthop_num, bnc->nexthop_num,
+ bnc->flags);
}
if (metric != bnc->metric)
@@ -678,6 +679,8 @@ evaluate_paths (struct bgp_nexthop_cache *bnc)
struct bgp *bgp = bnc->bgp;
int afi;
struct peer *peer = (struct peer *)bnc->nht_info;
+ struct bgp_table *table;
+ safi_t safi;
if (BGP_DEBUG(nht, NHT))
{
@@ -695,7 +698,10 @@ evaluate_paths (struct bgp_nexthop_cache *bnc)
continue;
rn = path->net;
+ assert (rn && bgp_node_table (rn));
afi = family2afi(rn->p.family);
+ table = bgp_node_table (rn);
+ safi = table->safi;
/* Path becomes valid/invalid depending on whether the nexthop
* reachable/unreachable.
@@ -705,15 +711,13 @@ evaluate_paths (struct bgp_nexthop_cache *bnc)
{
if (CHECK_FLAG (path->flags, BGP_INFO_VALID))
{
- bgp_aggregate_decrement (bgp, &rn->p, path,
- afi, SAFI_UNICAST);
+ bgp_aggregate_decrement (bgp, &rn->p, path, afi, safi);
bgp_info_unset_flag (rn, path, BGP_INFO_VALID);
}
else
{
bgp_info_set_flag (rn, path, BGP_INFO_VALID);
- bgp_aggregate_increment (bgp, &rn->p, path,
- afi, SAFI_UNICAST);
+ bgp_aggregate_increment (bgp, &rn->p, path, afi, safi);
}
}
@@ -727,7 +731,7 @@ evaluate_paths (struct bgp_nexthop_cache *bnc)
CHECK_FLAG(bnc->change_flags, BGP_NEXTHOP_CHANGED))
SET_FLAG(path->flags, BGP_INFO_IGP_CHANGED);
- bgp_process(bgp, rn, afi, SAFI_UNICAST);
+ bgp_process(bgp, rn, afi, safi);
}
if (peer && !CHECK_FLAG(bnc->flags, BGP_NEXTHOP_PEER_NOTIFIED))