Fix: correctly broadcast ARP MAC and IP reply for fake gateway
Change-Id: I5c45473496c44e7faa7ee8f3f178f396f39df9bd
(cherry picked from commit aec1b136f6f908b67a19c5e58cd8cbbeaf37769e)
diff --git a/apps/openstacknetworking/app/src/main/java/org/onosproject/openstacknetworking/impl/OpenstackRoutingArpHandler.java b/apps/openstacknetworking/app/src/main/java/org/onosproject/openstacknetworking/impl/OpenstackRoutingArpHandler.java
index 0ea2504..4f2c344 100644
--- a/apps/openstacknetworking/app/src/main/java/org/onosproject/openstacknetworking/impl/OpenstackRoutingArpHandler.java
+++ b/apps/openstacknetworking/app/src/main/java/org/onosproject/openstacknetworking/impl/OpenstackRoutingArpHandler.java
@@ -572,14 +572,20 @@
.matchArpTpa(ipAddress.getIp4Address())
.build();
- TrafficTreatment treatment = DefaultTrafficTreatment.builder()
- .setArpOp(ARP.OP_REPLY)
- .setArpSha(MacAddress.valueOf(gatewayMac))
- .setArpSpa(ipAddress.getIp4Address())
- .setOutput(PortNumber.IN_PORT)
- .build();
+ osNodeService.completeNodes(GATEWAY).forEach(n -> {
+ Device device = deviceService.getDevice(n.intgBridge());
- osNodeService.completeNodes(GATEWAY).forEach(n ->
+ TrafficTreatment treatment = DefaultTrafficTreatment.builder()
+ .extension(buildMoveEthSrcToDstExtension(device), device.id())
+ .extension(buildMoveArpShaToThaExtension(device), device.id())
+ .extension(buildMoveArpSpaToTpaExtension(device), device.id())
+ .setArpOp(ARP.OP_REPLY)
+ .setEthSrc(MacAddress.valueOf(gatewayMac))
+ .setArpSha(MacAddress.valueOf(gatewayMac))
+ .setArpSpa(ipAddress.getIp4Address())
+ .setOutput(PortNumber.IN_PORT)
+ .build();
+
osFlowRuleService.setRule(
appId,
n.intgBridge(),
@@ -588,7 +594,8 @@
PRIORITY_ARP_GATEWAY_RULE,
GW_COMMON_TABLE,
install
- )
+ );
+ }
);
if (install) {