alshabib

minor cleanup

...@@ -166,10 +166,11 @@ public class LinkDiscovery implements TimerTask { ...@@ -166,10 +166,11 @@ public class LinkDiscovery implements TimerTask {
166 * 166 *
167 * @param port the port 167 * @param port the port
168 */ 168 */
169 - public void removePort(final OFPort port) { 169 + public void removePort(final OFPortDesc port) {
170 // Ignore ports that are not on this switch 170 // Ignore ports that are not on this switch
171 171
172 - int portnum = port.getPortNumber(); 172 + int portnum = port.getPortNo().getPortNumber();
173 + this.ports.remove(portnum);
173 synchronized (this) { 174 synchronized (this) {
174 if (this.slowPorts.contains(portnum)) { 175 if (this.slowPorts.contains(portnum)) {
175 this.slowPorts.remove(portnum); 176 this.slowPorts.remove(portnum);
...@@ -383,7 +384,7 @@ public class LinkDiscovery implements TimerTask { ...@@ -383,7 +384,7 @@ public class LinkDiscovery implements TimerTask {
383 384
384 public void removeAllPorts() { 385 public void removeAllPorts() {
385 for (OFPortDesc port : sw.getPorts()) { 386 for (OFPortDesc port : sw.getPorts()) {
386 - removePort(port.getPortNo()); 387 + removePort(port);
387 } 388 }
388 } 389 }
389 390
......
...@@ -125,7 +125,7 @@ public class OpenFlowLinkProvider extends AbstractProvider implements LinkProvid ...@@ -125,7 +125,7 @@ public class OpenFlowLinkProvider extends AbstractProvider implements LinkProvid
125 DeviceId.deviceId("of:" + Long.toHexString(dpid.value())), 125 DeviceId.deviceId("of:" + Long.toHexString(dpid.value())),
126 PortNumber.portNumber(port.getPortNo().getPortNumber())); 126 PortNumber.portNumber(port.getPortNo().getPortNumber()));
127 providerService.linksVanished(cp); 127 providerService.linksVanished(cp);
128 - ld.removePort(port.getPortNo()); 128 + ld.removePort(port);
129 } 129 }
130 130
131 } 131 }
......