commit | 3aeaf729c03bd9eb7012173adb16736dc7eb1bad | [log] [tgz] |
---|---|---|
author | Lei Xu <x.rayyle@gmail.com> | Thu Aug 11 13:51:12 2016 -0700 |
committer | Gerrit Code Review <gerrit@onlab.us> | Tue Aug 16 21:37:59 2016 +0000 |
tree | 68806c33e74588b932b21bef9281c8da8932f5f4 | |
parent | 4859b3ab6ffa2556108dab2a55d6b95d679ceed8 [diff] |
[ONOS-3159] fix a concurrency issue in DHCPRelay.java Change-Id: Ib9bc5d0f0e788ceabc5272a05ac52a6753a3a229
diff --git a/apps/dhcprelay/src/main/java/org/onosproject/dhcprelay/DhcpRelay.java b/apps/dhcprelay/src/main/java/org/onosproject/dhcprelay/DhcpRelay.java index 0bb5dff..273e32b 100644 --- a/apps/dhcprelay/src/main/java/org/onosproject/dhcprelay/DhcpRelay.java +++ b/apps/dhcprelay/src/main/java/org/onosproject/dhcprelay/DhcpRelay.java
@@ -384,6 +384,10 @@ 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 @@ } } } -} \ No newline at end of file +}