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
Boris Kocherov
re6stnet
Commits
c97ab3d7
Commit
c97ab3d7
authored
Jul 20, 2017
by
Julien Muchembled
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Fix broadcast of new network parameters in LAN with only "light" nodes
parent
0ed6077d
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
31 additions
and
20 deletions
+31
-20
re6st/tunnel.py
re6st/tunnel.py
+31
-20
No files found.
re6st/tunnel.py
View file @
c97ab3d7
...
...
@@ -218,14 +218,28 @@ class BaseTunnelManager(object):
def
refresh
(
self
):
if
self
.
_next_rina
and
rina
.
update
(
self
,
False
):
self
.
_next_rina
=
False
self
.
ctl
.
request_dump
(
)
self
.
__request_dump
(
'rina'
)
self
.
_next_refresh
=
time
.
time
()
+
self
.
cache
.
hello
self
.
checkRoutingCache
()
def
babel_dump
(
self
):
def
__request_dump
(
self
,
reason
):
try
:
requesting_dump
=
self
.
__requesting_dump
except
AttributeError
:
requesting_dump
=
self
.
__requesting_dump
=
set
()
if
not
requesting_dump
:
self
.
ctl
.
request_dump
()
requesting_dump
.
add
(
reason
)
def
_babel_dump_rina
(
self
):
rina
.
update
(
self
,
True
)
self
.
_next_rina
=
True
def
babel_dump
(
self
):
for
x
in
self
.
__requesting_dump
:
getattr
(
self
,
'_babel_dump_'
+
x
)()
self
.
__requesting_dump
.
clear
()
def
selectTimeout
(
self
,
next
,
callback
,
force
=
True
):
t
=
self
.
_timeouts
for
i
,
x
in
enumerate
(
t
):
...
...
@@ -454,8 +468,18 @@ class BaseTunnelManager(object):
raise
utils
.
ReexecException
(
"Restart with new network parameters"
)
def
_newVersion
(
self
):
pass
def
_babel_dump_new_version
(
self
):
for
prefix
in
self
.
ctl
.
neighbours
:
if
prefix
:
peer
=
self
.
_getPeer
(
prefix
)
if
peer
.
prefix
!=
prefix
:
self
.
sendto
(
prefix
,
None
)
elif
(
peer
.
version
<
self
.
_version
and
self
.
sendto
(
prefix
,
'
\
0
'
+
self
.
_version
)):
peer
.
version
=
self
.
_version
def
broadcastNewVersion
(
self
):
self
.
__request_dump
(
'new_version'
)
def
newVersion
(
self
):
changed
=
self
.
cache
.
updateConfig
()
...
...
@@ -466,7 +490,7 @@ class BaseTunnelManager(object):
logging
.
info
(
"changed: %r"
,
changed
)
self
.
selectTimeout
(
None
,
self
.
newVersion
)
self
.
_version
=
self
.
cache
.
version
self
.
_n
ewVersion
()
self
.
broadcastN
ewVersion
()
self
.
cache
.
warnProtocol
()
crl
=
self
.
cache
.
crl
for
i
in
reversed
([
i
for
i
,
peer
in
enumerate
(
self
.
_peers
)
...
...
@@ -894,21 +918,8 @@ class TunnelManager(BaseTunnelManager):
if
address
:
self
.
_address
[
family
]
=
utils
.
dump_address
(
address
)
def
_newVersion
(
self
):
# BUG: In the case of a LAN without any node using TunnelManager
# (i.e. no creation/destruction of tunnels) and at least one
# connected to outside with --client, the new version is not
# propagated. This first loop should be moved to the base class,
# which would query Babel for neighbours only on this event,
# and not periodically like TunnelManager.
for
prefix
in
self
.
ctl
.
neighbours
:
if
prefix
:
peer
=
self
.
_getPeer
(
prefix
)
if
peer
.
prefix
!=
prefix
:
self
.
sendto
(
prefix
,
None
)
elif
(
peer
.
version
<
self
.
_version
and
self
.
sendto
(
prefix
,
'
\
0
'
+
self
.
_version
)):
peer
.
version
=
self
.
_version
def
broadcastNewVersion
(
self
):
self
.
_babel_dump_new_version
()
for
prefix
,
c
in
self
.
_connection_dict
.
items
():
if
c
.
serial
in
self
.
cache
.
crl
:
self
.
_kill
(
prefix
)
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