Changes to skip non null inactive interfaces in initStaticRib
@@ -8,6 +8,7 @@ import java.util.Set;
import java.util.SortedSet;
import java.util.TreeSet;
import java.util.stream.Collectors;
+import javax.annotation.Nullable;
import org.batfish.common.BatfishException;
import org.batfish.common.util.ComparableStructure;
import org.batfish.datamodel.AbstractRoute;
@@ -635,14 +636,17 @@ public class VirtualRouter extends ComparableStructure<String> {
_staticInterfaceRib = new StaticRib(this);
}
+
public void initStaticRib() {
for (StaticRoute sr : _vrf.getStaticRoutes()) {
String nextHopInt = sr.getNextHopInterface();
- if (nextHopInt != null
- && !Interface.NULL_INTERFACE_NAME.equals(nextHopInt)
- && !_vrf.getInterfaces().get(nextHopInt).getActive()) {
+
+ // Skip known interfaces that are down.
+ @Nullable Interface iface = _vrf.getInterfaces().get(nextHopInt);
+ if (iface != null && !iface.getActive()) {
continue;
}
+
// interface route
if (sr.getNextHopIp().equals(Route.UNSET_ROUTE_NEXT_HOP_IP)) {
_staticInterfaceRib.mergeRoute(sr);
@@ -652,6 +656,7 @@ public class VirtualRouter extends ComparableStructure<String> {
}
}
+
public int propagateBgpRoutes(Map<String, Node> nodes, Map<Ip, Set<String>> ipOwners) {
int numRoutes = 0;
_receivedBgpAdvertisements = new AdvertisementSet();
