diff --git a/src/main/java/net/floodlightcontroller/topology/TopologyManager.java b/src/main/java/net/floodlightcontroller/topology/TopologyManager.java
index 77dcc9651f6fc08c3b7bd76af854be4b19fee9b5..8192e33668b9c37b37813acc860cd36bdcc11db2 100644
--- a/src/main/java/net/floodlightcontroller/topology/TopologyManager.java
+++ b/src/main/java/net/floodlightcontroller/topology/TopologyManager.java
@@ -297,8 +297,20 @@ ITopologyManagerBackend, ILinkDiscoveryListener, IOFMessageListener {
             return false;
 
         // Check whether the port is a physical port. We should not learn
-        // attachment points on "special" ports.
-        if ((port.getShortPortNumber() & 0xff00) == 0xff00 && port.getShortPortNumber() != (short)0xfffe) return false;
+        // attachment points on "special" ports. Exclude LOCAL, where devices
+        // might live if they are on the switch OS itself
+        if (port.equals(OFPort.ALL) || 
+                port.equals(OFPort.CONTROLLER) || 
+                port.equals(OFPort.ANY) ||
+                port.equals(OFPort.FLOOD) ||
+                port.equals(OFPort.ZERO) ||
+                port.equals(OFPort.NO_MASK) ||
+                port.equals(OFPort.IN_PORT) ||
+                port.equals(OFPort.NORMAL) ||
+                port.equals(OFPort.TABLE)
+                ) {
+            return false;
+        }
 
         // Make sure that the port is enabled.
         IOFSwitch sw = switchService.getActiveSwitch(switchid);