Fix: only reply ARP request from external router
Change-Id: Ieed4f49c0ae607d2318ab6cfafea19d62a87c344
diff --git a/apps/openstacknetworking/app/src/main/java/org/onosproject/openstacknetworking/impl/OpenstackRoutingFloatingIpHandler.java b/apps/openstacknetworking/app/src/main/java/org/onosproject/openstacknetworking/impl/OpenstackRoutingFloatingIpHandler.java
index 6e9d71b..5b5e8a7 100644
--- a/apps/openstacknetworking/app/src/main/java/org/onosproject/openstacknetworking/impl/OpenstackRoutingFloatingIpHandler.java
+++ b/apps/openstacknetworking/app/src/main/java/org/onosproject/openstacknetworking/impl/OpenstackRoutingFloatingIpHandler.java
@@ -507,15 +507,17 @@
GW_COMMON_TABLE,
install);
- setArpRule(floatingIp, instPort.macAddress(), selectedGatewayNode, install);
+ setArpRule(floatingIp, instPort.macAddress(), externalPeerRouter, selectedGatewayNode, install);
}
private void setArpRule(NetFloatingIP floatingIp, MacAddress targetMac,
+ ExternalPeerRouter externalPeerRouter,
OpenstackNode gateway, boolean install) {
- if (ARP_BROADCAST_MODE.equals(getArpMode())) {
+ if (ARP_BROADCAST_MODE.equals(getArpMode()) && externalPeerRouter.ipAddress() != null) {
TrafficSelector selector = DefaultTrafficSelector.builder()
.matchInPort(gateway.uplinkPortNum())
.matchEthType(EthType.EtherType.ARP.ethType().toShort())
+ .matchArpSpa(Ip4Address.valueOf(externalPeerRouter.ipAddress().toString()))
.matchArpOp(ARP.OP_REQUEST)
.matchArpTpa(Ip4Address.valueOf(floatingIp.getFloatingIpAddress()))
.build();