isisd: fix isis_route_merge_verify logic

This addresses two issues for L1L2 operation:

a) If an L1 route has ROUTE_ACTIVE unset and an L2 route for the same
destination has ROUTE_ACTIVE set, isisd would still put the L1 route
into the merged table. This causes the route for the destination to
get uninstalled from zebra until the next SPF run, which is incorrect.

To fix this, look at the ROUTE_ACTIVE flag and allow L2 routes to win
against L1 routes, when the L1 has ROUTE_ACTIVE unset.

b) If an L1 route wins against an existing L2 route, the ZEBRA_SYNCED
flag would remain on the L2 route. This leads to the problem that when
the L1 route disappears again, the L2 doesn't get reinstalled, since
isisd assumes it's already in the RIB because ZEBRA_SYNCED is set.

Solve this by clearing ZEBRA_SYNCED on L2 routes, if they lose against
an L1 route.

Signed-off-by: Christian Franke <chris@opensourcerouting.org>
This commit is contained in:
Christian Franke 2018-07-26 10:02:15 +02:00
parent c30f211bba
commit 26b0598f6b

View File

@ -490,12 +490,37 @@ void isis_route_verify_merge(struct isis_area *area,
for (int level = ISIS_LEVEL1; level <= ISIS_LEVEL2; level++) {
for (rnode = route_top(tables[level - 1]); rnode;
rnode = route_next(rnode)) {
if (rnode->info == NULL)
struct isis_route_info *rinfo = rnode->info;
if (!rinfo)
continue;
mrnode = route_node_get(merge, &rnode->p);
if (mrnode->info != NULL) {
struct isis_route_info *mrinfo = mrnode->info;
if (mrinfo) {
route_unlock_node(mrnode);
continue;
if (CHECK_FLAG(mrinfo->flag,
ISIS_ROUTE_FLAG_ACTIVE)) {
/* Clear the ZEBRA_SYNCED flag on the
* L2 route when L1 wins, otherwise L2
* won't get reinstalled when L1
* disappears.
*/
UNSET_FLAG(
rinfo->flag,
ISIS_ROUTE_FLAG_ZEBRA_SYNCED
);
continue;
} else {
/* Clear the ZEBRA_SYNCED flag on the L1
* route when L2 wins, otherwise L1
* won't get reinstalled when it
* reappears.
*/
UNSET_FLAG(
mrinfo->flag,
ISIS_ROUTE_FLAG_ZEBRA_SYNCED
);
}
}
mrnode->info = rnode->info;
}