[ONOS-4502]Fix the bug about the different tenant and the same subnet.With different tenants and the same subnets, only one of the subnets can ping external network well.
Change-Id: I2ad2c100e933e6c22a7e728f8991967d17ede4c9
diff --git a/apps/vtn/vtnmgr/src/main/java/org/onosproject/vtn/table/impl/ClassifierServiceImpl.java b/apps/vtn/vtnmgr/src/main/java/org/onosproject/vtn/table/impl/ClassifierServiceImpl.java
index 030c783..c41aafe 100644
--- a/apps/vtn/vtnmgr/src/main/java/org/onosproject/vtn/table/impl/ClassifierServiceImpl.java
+++ b/apps/vtn/vtnmgr/src/main/java/org/onosproject/vtn/table/impl/ClassifierServiceImpl.java
@@ -194,6 +194,30 @@
}
@Override
+ public void programArpClassifierRules(DeviceId deviceId, PortNumber inPort,
+ IpAddress dstIp,
+ SegmentationId actionVni,
+ Objective.Operation type) {
+ TrafficSelector selector = DefaultTrafficSelector.builder()
+ .matchInPort(inPort).matchEthType(ETH_TYPE.ethType().toShort())
+ .matchArpTpa(Ip4Address.valueOf(dstIp.toString())).build();
+ TrafficTreatment treatment = DefaultTrafficTreatment.builder()
+ .setTunnelId(Long.parseLong(actionVni.segmentationId()))
+ .build();
+ ForwardingObjective.Builder objective = DefaultForwardingObjective
+ .builder().withTreatment(treatment).withSelector(selector)
+ .fromApp(appId).withFlag(Flag.SPECIFIC)
+ .withPriority(ARP_CLASSIFIER_PRIORITY);
+ if (type.equals(Objective.Operation.ADD)) {
+ log.debug("ArpClassifierRules-->ADD");
+ flowObjectiveService.forward(deviceId, objective.add());
+ } else {
+ log.debug("ArpClassifierRules-->REMOVE");
+ flowObjectiveService.forward(deviceId, objective.remove());
+ }
+ }
+
+ @Override
public void programUserdataClassifierRules(DeviceId deviceId,
IpPrefix ipPrefix,
IpAddress dstIp,