if (vlan != null && vlan.shortValue() <= 0)
vlan = null;
if (ipv4Address != null && ipv4Address == 0)
ipv4Address = null;
IDevice res = learnDeviceByEntity(new Entity(macAddress, vlan,
ipv4Address, switchDPID,
switchPort, new Date()));
// Restore listeners
if (listeners != null) {
for (IDeviceListener listener : listeners) {