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
2
Issues
2
List
Boards
Labels
Milestones
Merge Requests
4
Merge Requests
4
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
nexedi
re6stnet
Commits
ac0f161b
Commit
ac0f161b
authored
Sep 09, 2012
by
Julien Muchembled
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Prefer routing via interfaces specified by -i option
parent
e7abbba0
Changes
2
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
11 additions
and
9 deletions
+11
-9
re6st/plib.py
re6st/plib.py
+8
-6
re6stnet
re6stnet
+3
-3
No files found.
re6st/plib.py
View file @
ac0f161b
...
...
@@ -53,8 +53,8 @@ def client(iface, server_address, encrypt, *args, **kw):
def
router
(
network
,
subnet
,
subnet_size
,
hello_interval
,
log_path
,
state_path
,
pidfile
,
*
args
,
**
kw
):
args
=
[
'babeld'
,
pidfile
,
tunnel_interfaces
,
*
args
,
**
kw
):
cmd
=
[
'babeld'
,
'-C'
,
'redistribute local ip %s/%s le %s'
%
(
subnet
,
subnet_size
,
subnet_size
),
'-C'
,
'redistribute local deny'
,
'-C'
,
'redistribute ip %s/%s le %s'
%
(
subnet
,
subnet_size
,
subnet_size
),
...
...
@@ -74,13 +74,15 @@ def router(network, subnet, subnet_size, hello_interval, log_path, state_path,
'-L'
,
log_path
,
'-S'
,
state_path
,
'-I'
,
pidfile
,
'-s'
,
]
+
list
(
args
)
'-s'
]
for
iface
in
tunnel_interfaces
:
cmd
+=
'-C'
,
'interface %s rxcost 512'
%
iface
cmd
+=
args
# WKRD: babeld fails to start if pidfile already exists
try
:
os
.
remove
(
pidfile
)
except
OSError
,
e
:
if
e
.
errno
!=
errno
.
ENOENT
:
raise
logging
.
info
(
'%r'
,
args
)
return
subprocess
.
Popen
(
args
,
**
kw
)
logging
.
info
(
'%r'
,
cmd
)
return
subprocess
.
Popen
(
cmd
,
**
kw
)
re6stnet
View file @
ac0f161b
...
...
@@ -145,7 +145,6 @@ def main():
ip_changed
=
None
for
x
in
pp
:
server_tunnels
.
setdefault
(
're6stnet-'
+
x
[
1
],
x
)
config
.
babel_args
+=
server_tunnels
def
call
(
*
args
,
**
kw
):
r
=
subprocess
.
call
(
*
args
,
**
kw
)
...
...
@@ -160,6 +159,7 @@ def main():
my_ip
=
'%s/%s'
%
(
utils
.
ipFromBin
(
subnet
,
'1'
),
len
(
subnet
))
# Init db and tunnels
tunnel_interfaces
=
server_tunnels
.
keys
()
timeout
=
4
*
config
.
hello
if
config
.
client_count
and
not
config
.
client
:
required
(
'registry'
)
...
...
@@ -171,7 +171,7 @@ def main():
config
.
openvpn_args
,
timeout
,
config
.
tunnel_refresh
,
config
.
client_count
,
config
.
iface_list
,
network
,
prefix
,
address
,
ip_changed
,
config
.
encrypt
)
config
.
babel_arg
s
+=
tunnel_manager
.
free_interface_set
tunnel_interface
s
+=
tunnel_manager
.
free_interface_set
else
:
tunnel_manager
=
write_pipe
=
None
...
...
@@ -179,7 +179,7 @@ def main():
router
=
plib
.
router
(
network
,
utils
.
ipFromBin
(
subnet
),
len
(
subnet
),
config
.
hello
,
os
.
path
.
join
(
config
.
log
,
'babeld.log'
),
os
.
path
.
join
(
config
.
state
,
'babeld.state'
),
config
.
babel_pidfile
,
*
config
.
babel_args
)
config
.
babel_pidfile
,
tunnel_interfaces
,
*
config
.
babel_args
)
try
:
cleanup
=
[]
...
...
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