Disabling host probing for now because it needs to consider the source of the probes.
Also fixed HostLocationProvider to not learn hosts with broadcast addresses.
ONOS-5317.
Change-Id: Ie94032cca6e488960d7181839882db55dd2da743
(cherry picked from commit 338991e56edd960513451f559fc011f7fb27a1a7)
diff --git a/providers/host/src/main/java/org/onosproject/provider/host/impl/HostLocationProvider.java b/providers/host/src/main/java/org/onosproject/provider/host/impl/HostLocationProvider.java
index daf7134..d91d437 100644
--- a/providers/host/src/main/java/org/onosproject/provider/host/impl/HostLocationProvider.java
+++ b/providers/host/src/main/java/org/onosproject/provider/host/impl/HostLocationProvider.java
@@ -44,7 +44,6 @@
import org.onosproject.net.Host;
import org.onosproject.net.HostId;
import org.onosproject.net.HostLocation;
-import org.onosproject.net.MastershipRole;
import org.onosproject.net.device.DeviceEvent;
import org.onosproject.net.device.DeviceListener;
import org.onosproject.net.device.DeviceService;
@@ -270,14 +269,20 @@
@Override
public void triggerProbe(Host host) {
log.info("Triggering probe on device {} ", host);
- MastershipRole role = deviceService.getRole(host.location().deviceId());
- if (role.equals(MastershipRole.MASTER)) {
- host.ipAddresses().forEach(ip -> {
- sendProbe(host, ip);
- });
- } else {
- log.info("not the master, master will probe {}");
- }
+
+ // FIXME Disabling host probing for now, because sending packets from a
+ // broadcast MAC address caused problems when two ONOS networks were
+ // interconnected. Host probing should take into account the interface
+ // configuration when determining which source address to use.
+
+ //MastershipRole role = deviceService.getRole(host.location().deviceId());
+ //if (role.equals(MastershipRole.MASTER)) {
+ // host.ipAddresses().forEach(ip -> {
+ // sendProbe(host, ip);
+ // });
+ //} else {
+ // log.info("not the master, master will probe {}");
+ //}
}
private void sendProbe(Host host, IpAddress targetIp) {
@@ -287,7 +292,7 @@
probePacket = buildArpRequest(targetIp, host);
} else {
// IPv6: Use Neighbor Discovery
- //FIX ME need to implement ndp probe
+ //TODO need to implement ndp probe
log.info("Triggering probe on device {} ", host);
}
@@ -376,7 +381,11 @@
if (eth == null) {
return;
}
+
MacAddress srcMac = eth.getSourceMAC();
+ if (srcMac.isBroadcast() || srcMac.isMulticast()) {
+ return;
+ }
VlanId vlan = VlanId.vlanId(eth.getVlanID());
ConnectPoint heardOn = context.inPacket().receivedFrom();