Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
R
re6stnet
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
Analytics
Analytics
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
zhifan huang
re6stnet
Commits
35883799
Commit
35883799
authored
Apr 10, 2015
by
Julien Muchembled
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Comment the method selecting the tunnel to kill
parent
b4a9a612
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
12 additions
and
0 deletions
+12
-0
re6st/tunnel.py
re6st/tunnel.py
+12
-0
No files found.
re6st/tunnel.py
View file @
35883799
...
@@ -607,12 +607,24 @@ class TunnelManager(BaseTunnelManager):
...
@@ -607,12 +607,24 @@ class TunnelManager(BaseTunnelManager):
return
disconnected
return
disconnected
def
_tunnelScore
(
self
,
prefix
):
def
_tunnelScore
(
self
,
prefix
):
# First try to not kill a persistent tunnel (see --neighbour option).
# Then sort by the number of routed nodes.
n
=
0
n
=
0
try
:
try
:
for
x
in
self
.
ctl
.
neighbours
[
prefix
][
1
]:
for
x
in
self
.
ctl
.
neighbours
[
prefix
][
1
]:
# Ignore the default route, which is redundant with the
# border gateway node.
if
x
:
if
x
:
n
+=
1
n
+=
1
except
KeyError
:
except
KeyError
:
# XXX: The route for this neighbour is not direct. In this case,
# a KeyError was raised because babeld dump doesn't give us
# enough information to match the neighbour prefix with its
# link-local address. This is a good candidate (so we return
# ()), but for the same reason, such tunnel can't be killed.
# In order not to remain indefinitely in a state where we
# never delete any tunnel because we would always select an
# unkillable one, we should return an higher score.
pass
pass
return
(
prefix
in
self
.
_neighbour_set
,
n
)
if
n
else
()
return
(
prefix
in
self
.
_neighbour_set
,
n
)
if
n
else
()
...
...
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