Toggle navigation
Toggle navigation
This project
Loading...
Sign in
홍길동
/
onos
Go to a project
Toggle navigation
Toggle navigation pinning
Projects
Groups
Snippets
Help
Project
Activity
Repository
Pipelines
Graphs
Issues
0
Merge Requests
0
Wiki
Snippets
Network
Create a new issue
Builds
Commits
Issue Boards
Authored by
Thomas Vachuska
2014-10-22 16:40:44 -0700
Browse Files
Options
Browse Files
Download
Email Patches
Plain Diff
Commit
56dbeb18d35c026d849a2522a395ec8e22b4a153
56dbeb18
1 parent
ae968a66
Fixed a defect that allowed ancillary device providers to overwrite primary provider's data.
Expand all
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
10 additions
and
5 deletions
core/store/dist/src/main/java/org/onlab/onos/store/device/impl/GossipDeviceStore.java
core/store/trivial/src/main/java/org/onlab/onos/store/trivial/impl/SimpleDeviceStore.java
core/store/dist/src/main/java/org/onlab/onos/store/device/impl/GossipDeviceStore.java
View file @
56dbeb1
...
...
@@ -290,12 +290,17 @@ public class GossipDeviceStore
private
DeviceEvent
updateDevice
(
ProviderId
providerId
,
Device
oldDevice
,
Device
newDevice
,
Timestamp
newTimestamp
)
{
// We allow only certain attributes to trigger update
if
(!
Objects
.
equals
(
oldDevice
.
hwVersion
(),
newDevice
.
hwVersion
())
||
!
Objects
.
equals
(
oldDevice
.
swVersion
(),
newDevice
.
swVersion
())
||
!
AnnotationsUtil
.
isEqual
(
oldDevice
.
annotations
(),
newDevice
.
annotations
()))
{
boolean
propertiesChanged
=
!
Objects
.
equals
(
oldDevice
.
hwVersion
(),
newDevice
.
hwVersion
())
||
!
Objects
.
equals
(
oldDevice
.
swVersion
(),
newDevice
.
swVersion
());
boolean
annotationsChanged
=
!
AnnotationsUtil
.
isEqual
(
oldDevice
.
annotations
(),
newDevice
.
annotations
());
// Primary providers can respond to all changes, but ancillary ones
// should respond only to annotation changes.
if
((
providerId
.
isAncillary
()
&&
annotationsChanged
)
||
(!
providerId
.
isAncillary
()
&&
(
propertiesChanged
||
annotationsChanged
)))
{
boolean
replaced
=
devices
.
replace
(
newDevice
.
id
(),
oldDevice
,
newDevice
);
if
(!
replaced
)
{
verify
(
replaced
,
...
...
core/store/trivial/src/main/java/org/onlab/onos/store/trivial/impl/SimpleDeviceStore.java
View file @
56dbeb1
This diff is collapsed. Click to expand it.
Please
register
or
login
to post a comment