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
Joanne Hugé
re6stnet
Commits
c52ee536
Commit
c52ee536
authored
Aug 31, 2013
by
Jondy Zhao
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
fix problem: ovpn-client/server could not write data to pipe
parent
f6f91b10
Changes
4
Show whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
6 additions
and
8 deletions
+6
-8
re6st/ovpn-client.c
re6st/ovpn-client.c
+2
-3
re6st/ovpn-server.c
re6st/ovpn-server.c
+2
-3
re6st/plib.py
re6st/plib.py
+1
-1
re6st/tunnel.py
re6st/tunnel.py
+1
-1
No files found.
re6st/ovpn-client.c
View file @
c52ee536
...
@@ -2,7 +2,6 @@
...
@@ -2,7 +2,6 @@
int
main
(
int
argc
,
char
*
argv
[])
int
main
(
int
argc
,
char
*
argv
[])
{
{
char
*
p
;
int
pd
;
int
pd
;
char
buf
[
512
];
char
buf
[
512
];
int
n
;
int
n
;
...
@@ -22,8 +21,8 @@ int main(int argc, char *argv[])
...
@@ -22,8 +21,8 @@ int main(int argc, char *argv[])
return
1
;
return
1
;
}
}
pd
=
strtol
(
argv
[
1
],
&
p
,
10
);
pd
=
open
(
argv
[
1
],
1
);
if
(
!
(
*
p
==
0
)
)
{
if
(
pd
==
-
1
)
{
fprintf
(
stderr
,
"invalid pipe %s
\n
"
,
argv
[
1
]);
fprintf
(
stderr
,
"invalid pipe %s
\n
"
,
argv
[
1
]);
return
1
;
return
1
;
}
}
...
...
re6st/ovpn-server.c
View file @
c52ee536
...
@@ -14,7 +14,6 @@ if arg1 != 'None':
...
@@ -14,7 +14,6 @@ if arg1 != 'None':
*/
*/
int
main
(
int
argc
,
char
*
argv
[])
int
main
(
int
argc
,
char
*
argv
[])
{
{
char
*
p
;
int
pd
;
int
pd
;
char
buf
[
512
];
char
buf
[
512
];
int
n
;
int
n
;
...
@@ -67,8 +66,8 @@ int main(int argc, char *argv[])
...
@@ -67,8 +66,8 @@ int main(int argc, char *argv[])
if
(
strcmp
(
argv
[
1
],
"None"
)
==
0
)
if
(
strcmp
(
argv
[
1
],
"None"
)
==
0
)
return
0
;
return
0
;
pd
=
strtol
(
argv
[
1
],
&
p
,
10
);
pd
=
open
(
argv
[
1
],
1
);
if
(
!
(
*
p
==
0
)
)
{
if
(
pd
==
-
1
)
{
fprintf
(
stderr
,
"invalid pipe %s
\n
"
,
argv
[
1
]);
fprintf
(
stderr
,
"invalid pipe %s
\n
"
,
argv
[
1
]);
return
1
;
return
1
;
}
}
...
...
re6st/plib.py
View file @
c52ee536
...
@@ -31,7 +31,7 @@ def openvpn(iface, encrypt, *args, **kw):
...
@@ -31,7 +31,7 @@ def openvpn(iface, encrypt, *args, **kw):
def
server
(
iface
,
max_clients
,
dh_path
,
pipe_fd
,
port
,
proto
,
encrypt
,
*
args
,
**
kw
):
def
server
(
iface
,
max_clients
,
dh_path
,
pipe_fd
,
port
,
proto
,
encrypt
,
*
args
,
**
kw
):
client_script
=
'%s
%s'
%
(
ovpn_server
,
pipe_fd
)
client_script
=
'%s
/proc/%u/fd/%s'
%
(
ovpn_server
,
os
.
getpid
()
,
pipe_fd
)
if
pipe_fd
is
not
None
:
if
pipe_fd
is
not
None
:
args
=
(
'--client-disconnect'
,
client_script
)
+
args
args
=
(
'--client-disconnect'
,
client_script
)
+
args
return
openvpn
(
iface
,
encrypt
,
return
openvpn
(
iface
,
encrypt
,
...
...
re6st/tunnel.py
View file @
c52ee536
...
@@ -65,7 +65,7 @@ class Connection(object):
...
@@ -65,7 +65,7 @@ class Connection(object):
'--resolv-retry'
,
'0'
,
'--resolv-retry'
,
'0'
,
'--connect-retry-max'
,
'3'
,
'--tls-exit'
,
'--connect-retry-max'
,
'3'
,
'--tls-exit'
,
'--ping-exit'
,
str
(
timeout
),
'--ping-exit'
,
str
(
timeout
),
'--route-up'
,
'%s
%u'
%
(
plib
.
ovpn_client
,
write_pipe
),
'--route-up'
,
'%s
/proc/%u/fd/%u'
%
(
plib
.
ovpn_client
,
os
.
getpid
()
,
write_pipe
),
*
ovpn_args
)
*
ovpn_args
)
_retry
+=
1
_retry
+=
1
self
.
_retry
=
_retry
<
len
(
self
.
address_list
)
and
(
self
.
_retry
=
_retry
<
len
(
self
.
address_list
)
and
(
...
...
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