Add IfNewHostNotify to DeviceManager
[controller.git] / opendaylight / hosttracker_new / implementation / src / main / java / org / opendaylight / controller / hosttracker / internal / Device.java
index 50e77ec643298cef46c67d294b0c8242512db78f..a97cb273837257a23a34460696de49cf29942241 100755 (executable)
@@ -784,10 +784,14 @@ public class Device implements IDevice {
     public HostNodeConnector toHostNodeConnector() {
         Integer[] ipv4s = this.getIPv4Addresses();
         try {
+            Entity e = this.entities[this.entities.length-1];
+            NodeConnector n = null;
+            if(e!=null)
+                 n = e.getPort();
             InetAddress ip = InetAddress.getByName(ipv4s[ipv4s.length - 1]
                     .toString());
             byte[] macAddr = macLongToByte(this.getMACAddress());
-            HostNodeConnector nc = new HostNodeConnector(macAddr, ip, null,
+            HostNodeConnector nc = new HostNodeConnector(macAddr, ip, n,
                     (short) 0);
             return nc;
         } catch (Exception e) {