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
7d7d5ef6
Commit
7d7d5ef6
authored
Sep 10, 2012
by
Julien Muchembled
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Prevent default route to be followed for nothing
parent
eeaaa76f
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
10 additions
and
9 deletions
+10
-9
re6stnet
re6stnet
+10
-9
No files found.
re6stnet
View file @
7d7d5ef6
...
...
@@ -146,13 +146,16 @@ def main():
for
x
in
pp
:
server_tunnels
.
setdefault
(
're6stnet-'
+
x
[
1
],
x
)
def
call
(
*
args
,
**
kw
):
r
=
subprocess
.
call
(
*
args
,
**
kw
)
if
r
:
sys
.
exit
(
r
)
def
required
(
arg
):
if
not
getattr
(
config
,
arg
):
sys
.
exit
(
"error: argument --%s is required"
%
arg
)
def
ip
(
object
,
*
args
):
args
=
[
'ip'
,
object
,
'add'
]
+
list
(
args
)
r
=
subprocess
.
call
(
args
)
if
r
:
sys
.
exit
(
r
)
args
[
2
]
=
'del'
cleanup
.
append
(
lambda
:
subprocess
.
call
(
args
))
try
:
subnet
=
network
+
prefix
...
...
@@ -183,6 +186,8 @@ def main():
try
:
cleanup
=
[]
my_network
=
"%s/%u"
%
(
utils
.
ipFromBin
(
network
),
len
(
network
))
ip
(
'route'
,
'unreachable'
,
my_network
,
'proto'
,
'static'
)
# prepare persistent interfaces
if
config
.
client
:
cleanup
.
append
(
plib
.
client
(
're6stnet'
,
config
.
client
,
...
...
@@ -206,11 +211,7 @@ def main():
" when --max-clients is 0"
)
if
config
.
main_interface
:
ip_args
=
[
'ip'
,
'addr'
,
'add'
,
my_ip
,
'dev'
,
config
.
main_interface
]
call
(
ip_args
)
ip_args
[
2
]
=
'del'
cleanup
.
append
(
lambda
:
call
(
ip_args
))
ip
(
'addr'
,
my_ip
,
'dev'
,
config
.
main_interface
)
# main loop
if
tunnel_manager
is
None
:
...
...
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