You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Hi, I'm reading and running the source code of batfish recently. And found a possible bug in the removeRouteGetDelta(R route) function of the BgpRib<R>. That is, if the route to be removed is a backup route of the BgpRib<R>, the entry of the route in _logicalArrivalTime cannot be removed.
The first line of this function shows it calls the super function, i.e., AbstractRib<R>.removeRouteGetDelta(R route), which returns the delta of removing the route from the underlying RibTree:
public@NonnullRibDelta<R> removeRouteGetDelta(Rroute) {
// Remove the backup route first, then remove route from ribremoveBackupRoute(route);
RibDelta<R> delta = _tree.removeRouteGetDelta(route, Reason.WITHDRAW);
if (!delta.isEmpty()) {
// A change to routes has been made_allRoutes = null;
}
returndelta;
}
However, since the route is not a best route, _tree.removeRouteGetDelta(route, Reason.WITHDRAW) returns an empty delta (since _root does not contain route):
@NonnullRibDelta<R> removeRouteGetDelta(Rroute, Reasonreason) {
assertreason != Reason.ADD : "cannot remove a route with reason ADD";
Prefixnetwork = route.getNetwork();
booleanremoved = _root.remove(network, route);
if (!removed) {
returnRibDelta.empty();
}
......
}
Thus, the if blocks (i.e., line 331-340) in BgpRib.mergeRouteGetDelta is not executed, and the entry of route in the _logicalArrivalTime cannot be removed (i.e., line 336 is not executed).
The text was updated successfully, but these errors were encountered:
Hi, I'm reading and running the source code of batfish recently. And found a possible bug in the
removeRouteGetDelta(R route)
function of theBgpRib<R>
. That is, if theroute
to be removed is a backup route of theBgpRib<R>
, the entry of theroute
in_logicalArrivalTime
cannot be removed.In
BgpRib<R>
:The first line of this function shows it calls the super function, i.e.,
AbstractRib<R>.removeRouteGetDelta(R route)
, which returns the delta of removing theroute
from the underlyingRibTree
:However, since the
route
is not a best route,_tree.removeRouteGetDelta(route, Reason.WITHDRAW)
returns an empty delta (since_root
does not containroute
):Thus, the
if
blocks (i.e., line 331-340) inBgpRib.mergeRouteGetDelta
is not executed, and the entry ofroute
in the_logicalArrivalTime
cannot be removed (i.e., line 336 is not executed).The text was updated successfully, but these errors were encountered: