Lei Xu
Committed by Gerrit Code Review

[ONOS-3159] fix a concurrency issue in DHCPRelay.java

Change-Id: Ib9bc5d0f0e788ceabc5272a05ac52a6753a3a229
......@@ -384,6 +384,10 @@ public class DhcpRelay {
MacAddress descMac = new MacAddress(dhcpPayload.getClientHardwareAddress());
Host host = hostService.getHost(HostId.hostId(descMac,
VlanId.vlanId(ethPacket.getVlanID())));
//handle the concurrent host offline scenario
if (host == null) {
return;
}
ConnectPoint dhcpRequestor = new ConnectPoint(host.location().elementId(),
host.location().port());
......@@ -414,4 +418,4 @@ public class DhcpRelay {
}
}
}
}
\ No newline at end of file
}
......