batfish / batfish

Batfish is a network configuration analysis tool that can find bugs and guarantee the correctness of (planned or current) network configurations. It enables network engineers to rapidly and safely evolve their network, without fear of outages or security breaches.

Home Page:http://www.batfish.org

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Bugs in setting the ingress replication protocol

LiuXinZhe21 opened this issue · comments

Maybe there is a bug in the Cisco NxosControlPlaneExtractor class regarding the section 'exitNvm_ingress-replication'. I think the situation with unicast should only warn when all NVE's getHostReachabilityProtocol() are null.

public void exitNvm_ingress_replication(Nvm_ingress_replicationContext ctx) {
    if (ctx.BGP() != null) {
      if (_currentNves.stream()
          .anyMatch(nve -> nve.getHostReachabilityProtocol() != HostReachabilityProtocol.BGP)) {
        warn(
            ctx,
            "Cannot enable ingress replication bgp under VNI without host-reachability protocol"
                + " bgp");
        return;
      }
      _currentNveVnis.forEach(
          vni -> vni.setIngressReplicationProtocol(IngressReplicationProtocol.BGP));
    } else {
      assert ctx.STATIC() != null;
      if (_currentNves.stream().anyMatch(nve -> nve.getHostReachabilityProtocol() != null <maybe == null?>)) {
        warn(
            ctx,
            "Cannot enable ingress replication static under VNI without unset host-reachability"
                + " protocol");
        return;
      }
      _currentNveVnis.forEach(
          vni -> vni.setIngressReplicationProtocol(IngressReplicationProtocol.STATIC));
    }
  }

@arifogel can you take a look at this?