Program: 106213
Project: 106213
Buggy source:
private void connectBridgeToRouter(Network network,Bridge netBridge,Router netRouter){
  boolean isVpc=getIsVpc(network);
  long id=getRouterId(network,isVpc);
  String routerName=getRouterName(isVpc,id);
  String accountIdStr=String.valueOf(network.getAccountId());
  BridgePort bridgePort=netBridge.addInteriorPort().create();
  RouterPort routerPort=netRouter.addInteriorRouterPort();
  String cidr=network.getCidr();
  String cidrSubnet=NetUtils.getCidrSubNet(cidr);
  int cidrSize=(int)NetUtils.getCidrSize(NetUtils.cidr2Netmask(cidr));
  routerPort.networkAddress(cidrSubnet);
  routerPort.networkLength(cidrSize);
  routerPort.portAddress(network.getGateway());
  if (getIsVpc(network)) {
    int pos=1;
    RuleChain inc=api.addChain().name(getChainName(String.valueOf(network.getId()),routerName,RuleChainCode.ACL_INGRESS)).tenantId(accountIdStr).create();
    inc.addRule().type(DtoRule.Accept).dlType((short)0x0806).position(pos++).create();
    inc.addRule().type(DtoRule.Accept).matchReturnFlow(true).position(pos++).create();
    inc.addRule().type(DtoRule.Drop).position(pos).create();
    RuleChain out=api.addChain().name(getChainName(String.valueOf(network.getId()),routerName,RuleChainCode.ACL_EGRESS)).tenantId(accountIdStr).create();
    out.addRule().type(DtoRule.Accept).matchForwardFlow(true).position(1).create();
    routerPort.outboundFilterId(inc.getId());
    routerPort.inboundFilterId(out.getId());
  }
  routerPort.create();
  bridgePort.link(routerPort.getId()).update();
  netRouter.addRoute().type("String_Node_Str").weight(100).srcNetworkAddr("String_Node_Str").srcNetworkLength(0).dstNetworkAddr(cidrSubnet).dstNetworkLength(cidrSize).nextHopPort(routerPort.getId()).nextHopGateway(null).create();
}

Fixed version (ground truth):
private void connectBridgeToRouter(Network network,Bridge netBridge,Router netRouter){
  boolean isVpc=getIsVpc(network);
  long id=getRouterId(network,isVpc);
  String routerName=getRouterName(isVpc,id);
  String accountIdStr=getAccountUuid(network);
  BridgePort bridgePort=netBridge.addInteriorPort().create();
  RouterPort routerPort=netRouter.addInteriorRouterPort();
  String cidr=network.getCidr();
  String cidrSubnet=NetUtils.getCidrSubNet(cidr);
  int cidrSize=(int)NetUtils.getCidrSize(NetUtils.cidr2Netmask(cidr));
  routerPort.networkAddress(cidrSubnet);
  routerPort.networkLength(cidrSize);
  routerPort.portAddress(network.getGateway());
  if (getIsVpc(network)) {
    int pos=1;
    RuleChain inc=api.addChain().name(getChainName(String.valueOf(network.getId()),routerName,RuleChainCode.ACL_INGRESS)).tenantId(accountIdStr).create();
    inc.addRule().type(DtoRule.Accept).dlType((short)0x0806).position(pos++).create();
    inc.addRule().type(DtoRule.Accept).nwProto(SimpleFirewallRule.stringToProtocolNumber("String_Node_Str")).nwDstAddress(network.getGateway()).nwDstLength(32).position(pos++).create();
    inc.addRule().type(DtoRule.Accept).matchReturnFlow(true).position(pos++).create();
    inc.addRule().type(DtoRule.Drop).position(pos).create();
    RuleChain out=api.addChain().name(getChainName(String.valueOf(network.getId()),routerName,RuleChainCode.ACL_EGRESS)).tenantId(accountIdStr).create();
    out.addRule().type(DtoRule.Accept).matchForwardFlow(true).position(1).create();
    routerPort.outboundFilterId(inc.getId());
    routerPort.inboundFilterId(out.getId());
  }
  routerPort.create();
  bridgePort.link(routerPort.getId()).update();
  netRouter.addRoute().type("String_Node_Str").weight(100).srcNetworkAddr("String_Node_Str").srcNetworkLength(0).dstNetworkAddr(cidrSubnet).dstNetworkLength(cidrSize).nextHopPort(routerPort.getId()).nextHopGateway(null).create();
}