Committed by
Gerrit Code Review
[ONOS-3159] fix a concurrency issue in DHCPRelay.java
Change-Id: Ib9bc5d0f0e788ceabc5272a05ac52a6753a3a229
Showing
1 changed file
with
4 additions
and
0 deletions
| ... | @@ -384,6 +384,10 @@ public class DhcpRelay { | ... | @@ -384,6 +384,10 @@ public class DhcpRelay { |
| 384 | MacAddress descMac = new MacAddress(dhcpPayload.getClientHardwareAddress()); | 384 | MacAddress descMac = new MacAddress(dhcpPayload.getClientHardwareAddress()); |
| 385 | Host host = hostService.getHost(HostId.hostId(descMac, | 385 | Host host = hostService.getHost(HostId.hostId(descMac, |
| 386 | VlanId.vlanId(ethPacket.getVlanID()))); | 386 | VlanId.vlanId(ethPacket.getVlanID()))); |
| 387 | + //handle the concurrent host offline scenario | ||
| 388 | + if (host == null) { | ||
| 389 | + return; | ||
| 390 | + } | ||
| 387 | ConnectPoint dhcpRequestor = new ConnectPoint(host.location().elementId(), | 391 | ConnectPoint dhcpRequestor = new ConnectPoint(host.location().elementId(), |
| 388 | host.location().port()); | 392 | host.location().port()); |
| 389 | 393 | ... | ... |
-
Please register or login to post a comment