HostMonitor: Only probe directly if we are not already monitoring the host.
Change-Id: I0ab7714056a19ee197dd16d2fe652bfa6a04115f
diff --git a/core/net/src/main/java/org/onosproject/net/host/impl/HostMonitor.java b/core/net/src/main/java/org/onosproject/net/host/impl/HostMonitor.java
index a3a3069..2ef6355 100644
--- a/core/net/src/main/java/org/onosproject/net/host/impl/HostMonitor.java
+++ b/core/net/src/main/java/org/onosproject/net/host/impl/HostMonitor.java
@@ -102,8 +102,9 @@
* @param ip IP address of the host to monitor
*/
void addMonitoringFor(IpAddress ip) {
- monitoredAddresses.add(ip);
- probe(ip);
+ if (monitoredAddresses.add(ip)) {
+ probe(ip);
+ }
}
/**
@@ -194,14 +195,14 @@
intf.ipAddressesList().stream()
.filter(ia -> ia.subnetAddress().contains(targetIp))
.forEach(ia -> {
- log.info("Sending probe for target:{} out of intf:{} vlan:{}",
+ log.debug("Sending probe for target:{} out of intf:{} vlan:{}",
targetIp, intf.connectPoint(), intf.vlan());
sendProbe(intf.connectPoint(), targetIp, ia.ipAddress(),
intf.mac(), intf.vlan());
// account for use-cases where tagged-vlan config is used
if (!intf.vlanTagged().isEmpty()) {
intf.vlanTagged().forEach(tag -> {
- log.info("Sending probe for target:{} out of intf:{} vlan:{}",
+ log.debug("Sending probe for target:{} out of intf:{} vlan:{}",
targetIp, intf.connectPoint(), tag);
sendProbe(intf.connectPoint(), targetIp, ia.ipAddress(),
intf.mac(), tag);