Jonathan Hart

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
...@@ -44,7 +44,6 @@ import org.onosproject.net.Device; ...@@ -44,7 +44,6 @@ import org.onosproject.net.Device;
44 import org.onosproject.net.Host; 44 import org.onosproject.net.Host;
45 import org.onosproject.net.HostId; 45 import org.onosproject.net.HostId;
46 import org.onosproject.net.HostLocation; 46 import org.onosproject.net.HostLocation;
47 -import org.onosproject.net.MastershipRole;
48 import org.onosproject.net.device.DeviceEvent; 47 import org.onosproject.net.device.DeviceEvent;
49 import org.onosproject.net.device.DeviceListener; 48 import org.onosproject.net.device.DeviceListener;
50 import org.onosproject.net.device.DeviceService; 49 import org.onosproject.net.device.DeviceService;
...@@ -270,14 +269,20 @@ public class HostLocationProvider extends AbstractProvider implements HostProvid ...@@ -270,14 +269,20 @@ public class HostLocationProvider extends AbstractProvider implements HostProvid
270 @Override 269 @Override
271 public void triggerProbe(Host host) { 270 public void triggerProbe(Host host) {
272 log.info("Triggering probe on device {} ", host); 271 log.info("Triggering probe on device {} ", host);
273 - MastershipRole role = deviceService.getRole(host.location().deviceId()); 272 +
274 - if (role.equals(MastershipRole.MASTER)) { 273 + // FIXME Disabling host probing for now, because sending packets from a
275 - host.ipAddresses().forEach(ip -> { 274 + // broadcast MAC address caused problems when two ONOS networks were
276 - sendProbe(host, ip); 275 + // interconnected. Host probing should take into account the interface
277 - }); 276 + // configuration when determining which source address to use.
278 - } else { 277 +
279 - log.info("not the master, master will probe {}"); 278 + //MastershipRole role = deviceService.getRole(host.location().deviceId());
280 - } 279 + //if (role.equals(MastershipRole.MASTER)) {
280 + // host.ipAddresses().forEach(ip -> {
281 + // sendProbe(host, ip);
282 + // });
283 + //} else {
284 + // log.info("not the master, master will probe {}");
285 + //}
281 } 286 }
282 287
283 private void sendProbe(Host host, IpAddress targetIp) { 288 private void sendProbe(Host host, IpAddress targetIp) {
...@@ -287,7 +292,7 @@ public class HostLocationProvider extends AbstractProvider implements HostProvid ...@@ -287,7 +292,7 @@ public class HostLocationProvider extends AbstractProvider implements HostProvid
287 probePacket = buildArpRequest(targetIp, host); 292 probePacket = buildArpRequest(targetIp, host);
288 } else { 293 } else {
289 // IPv6: Use Neighbor Discovery 294 // IPv6: Use Neighbor Discovery
290 - //FIX ME need to implement ndp probe 295 + //TODO need to implement ndp probe
291 log.info("Triggering probe on device {} ", host); 296 log.info("Triggering probe on device {} ", host);
292 } 297 }
293 298
...@@ -376,7 +381,11 @@ public class HostLocationProvider extends AbstractProvider implements HostProvid ...@@ -376,7 +381,11 @@ public class HostLocationProvider extends AbstractProvider implements HostProvid
376 if (eth == null) { 381 if (eth == null) {
377 return; 382 return;
378 } 383 }
384 +
379 MacAddress srcMac = eth.getSourceMAC(); 385 MacAddress srcMac = eth.getSourceMAC();
386 + if (srcMac.isBroadcast() || srcMac.isMulticast()) {
387 + return;
388 + }
380 389
381 VlanId vlan = VlanId.vlanId(eth.getVlanID()); 390 VlanId vlan = VlanId.vlanId(eth.getVlanID());
382 ConnectPoint heardOn = context.inPacket().receivedFrom(); 391 ConnectPoint heardOn = context.inPacket().receivedFrom();
......