Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
F
floodlight
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Model registry
Operate
Environments
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
croft1
floodlight
Commits
baa9ffc7
Commit
baa9ffc7
authored
13 years ago
by
Kanzhe Jiang
Browse files
Options
Downloads
Patches
Plain Diff
Change the networkAddr and AP aging removal code to correctly update all deviceMaps.
parent
167dee73
No related branches found
Branches containing commit
No related tags found
Tags containing commit
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
src/main/java/net/floodlightcontroller/devicemanager/internal/DeviceManagerImpl.java
+27
-2
27 additions, 2 deletions
...tcontroller/devicemanager/internal/DeviceManagerImpl.java
with
27 additions
and
2 deletions
src/main/java/net/floodlightcontroller/devicemanager/internal/DeviceManagerImpl.java
+
27
−
2
View file @
baa9ffc7
...
...
@@ -203,6 +203,10 @@ public class DeviceManagerImpl implements IDeviceManager, IOFMessageListener,
}
}
private
void
delFromIpv4AddressDeviceMap
(
Integer
ip
,
Device
d
)
{
ipv4AddressDeviceMap
.
remove
(
ip
);
}
private
void
updateSwitchDeviceMap
(
Device
d
)
{
// Find all the attachment points of this device
// Then find all the switches from the attachment points
...
...
@@ -410,6 +414,26 @@ public class DeviceManagerImpl implements IDeviceManager, IOFMessageListener,
}
}
/**
* Delete a network address from a device
* @param dlAddr The link layer address of the device
* @param nwAddr the new network layer address
*/
protected
void
delNwAddrByDataLayerAddr
(
long
dlAddr
,
int
nwAddr
)
{
Device
d
=
getDeviceByDataLayerAddr
(
dlAddr
);
if
(
d
==
null
)
return
;
Device
dCopy
=
new
Device
(
d
);
DeviceNetworkAddress
na
=
dCopy
.
getNetworkAddress
(
nwAddr
);
if
(
na
!=
null
)
{
delFromIpv4AddressDeviceMap
(
nwAddr
,
d
);
dCopy
.
removeNetworkAddress
(
na
);
updateMaps
(
dCopy
);
}
d
=
null
;
// to catch if anyone is using this reference
}
/**
* Add a device attachment point to the device with the given
* link-layer address
...
...
@@ -1652,7 +1676,8 @@ public class DeviceManagerImpl implements IDeviceManager, IOFMessageListener,
Date
agedBoundary
=
ageBoundaryDifference
(
currentDate
,
expire
);
if
(
address
.
getLastSeen
().
before
(
agedBoundary
))
{
device
.
removeNetworkAddress
(
address
.
getNetworkAddress
());
devMgrMaps
.
delNwAddrByDataLayerAddr
(
device
.
getDataLayerAddressAsLong
(),
address
.
getNetworkAddress
().
intValue
());
}
}
}
...
...
@@ -1668,7 +1693,7 @@ public class DeviceManagerImpl implements IDeviceManager, IOFMessageListener,
}
Date
agedBoundary
=
ageBoundaryDifference
(
currentDate
,
expire
);
if
(
ap
.
getLastSeen
().
before
(
agedBoundary
))
{
dev
ice
.
remove
AttachmentPoint
(
ap
.
getSwitchPort
());
dev
MgrMaps
.
delDev
AttachmentPoint
(
device
,
ap
.
getSwitchPort
());
evHistAttachmtPt
(
device
,
ap
.
getSwitchPort
(),
EvAction
.
REMOVED
,
"Aged"
);
}
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment