Skip to content
GitLab
Projects
Groups
Snippets
Help
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Sign in
Toggle navigation
R
router_services
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
1
Issues
1
List
Boards
Labels
Service Desk
Milestones
Iterations
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Operations
Operations
Incidents
Environments
Analytics
Analytics
CI / CD
Code Review
Repository
Value Stream
Wiki
Wiki
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
nova
router_services
Commits
5e8f4e94
Commit
5e8f4e94
authored
Nov 26, 2013
by
Sigmund Augdal
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Convert mac addresses to lower case wherever relevant
parent
b448b200
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
5 additions
and
1 deletion
+5
-1
neighbors.py
neighbors.py
+5
-1
No files found.
neighbors.py
View file @
5e8f4e94
...
...
@@ -47,11 +47,12 @@ class NeighborCache(object):
if
router
not
in
addresses
:
for
n
in
neighbors
:
if
n
.
get_attr
(
'NDA_DST'
)
==
router
:
self
.
blacklist_mac
.
add
(
n
.
get_attr
(
'NDA_LLADDR'
))
self
.
blacklist_mac
.
add
(
n
.
get_attr
(
'NDA_LLADDR'
)
.
lower
()
)
for
np
in
neighbors
:
self
.
process_event
(
np
)
def
get_ipaddress_from_mac
(
self
,
mac
,
addrtype
):
mac
=
mac
.
lower
()
try
:
return
self
.
etcd_client
.
get
(
etcd_key
(
mac
,
addrtype
)).
value
except
etcd
.
EtcdError
as
ex
:
...
...
@@ -76,9 +77,11 @@ class NeighborCache(object):
return
None
def
add_pair
(
self
,
mac
,
ipaddress
,
addrtype
):
mac
=
mac
.
lower
()
self
.
etcd_client
.
testandset
(
etcd_key
(
mac
,
addrtype
),
""
,
ipaddress
)
def
new
(
self
,
mac
,
ipaddr
,
addrtype
):
mac
=
mac
.
lower
()
old_address
=
self
.
get_ipaddress_from_mac
(
mac
,
addrtype
)
if
not
old_address
is
None
:
...
...
@@ -100,6 +103,7 @@ class NeighborCache(object):
self
.
add_pair
(
mac
,
ipaddr
,
addrtype
)
def
remove
(
self
,
mac
,
ipaddress
,
addrtype
):
mac
=
mac
.
lower
()
self
.
etcd_client
.
delete
(
etcd_key
(
mac
,
addrtype
))
def
process_event
(
self
,
np
):
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment