Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
C
com.ccwangluo.accelerator
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
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Analytics
Analytics
CI / CD
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
sheteng
com.ccwangluo.accelerator
Commits
18e62360
Commit
18e62360
authored
May 15, 2013
by
Max Lv
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
fix a bug in tun2socks
parent
f40fb626
Changes
5
Hide whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
9 additions
and
51 deletions
+9
-51
src/main/assets/arm/tun2socks
src/main/assets/arm/tun2socks
+0
-0
src/main/assets/x86/tun2socks
src/main/assets/x86/tun2socks
+0
-0
src/main/jni/badvpn/tun2socks/tun2socks.c
src/main/jni/badvpn/tun2socks/tun2socks.c
+9
-2
src/main/jni/badvpn/tuntap/BTap.c
src/main/jni/badvpn/tuntap/BTap.c
+0
-45
src/main/jni/badvpn/tuntap/BTap.h
src/main/jni/badvpn/tuntap/BTap.h
+0
-4
No files found.
src/main/assets/arm/tun2socks
View file @
18e62360
No preview for this file type
src/main/assets/x86/tun2socks
View file @
18e62360
No preview for this file type
src/main/jni/badvpn/tun2socks/tun2socks.c
View file @
18e62360
...
...
@@ -392,8 +392,15 @@ int main (int argc, char **argv)
#ifdef ANDROID
// use supplied file descriptor
if
(
!
BTap_InitWithFD
(
&
device
,
&
ss
,
options
.
tun_fd
,
options
.
tun_mtu
,
device_error_handler
,
NULL
,
1
))
{
BLog
(
BLOG_ERROR
,
"BTap_InitWithFD failed"
);
struct
BTap_init_data
init_data
;
init_data
.
dev_type
=
BTAP_DEV_TUN
;
init_data
.
init_type
=
BTAP_INIT_FD
;
init_data
.
init
.
fd
.
fd
=
options
.
tun_fd
;
init_data
.
init
.
fd
.
mtu
=
options
.
tun_mtu
;
if
(
!
BTap_Init2
(
&
device
,
&
ss
,
init_data
,
device_error_handler
,
NULL
))
{
BLog
(
BLOG_ERROR
,
"BTap_Init2 failed"
);
goto
fail3
;
}
#else
...
...
src/main/jni/badvpn/tuntap/BTap.c
View file @
18e62360
...
...
@@ -195,51 +195,6 @@ int BTap_Init (BTap *o, BReactor *reactor, char *devname, BTap_handler_error han
return
BTap_Init2
(
o
,
reactor
,
init_data
,
handler_error
,
handler_error_user
);
}
#ifdef ANDROID
int
BTap_InitWithFD
(
BTap
*
o
,
BReactor
*
reactor
,
int
fd
,
int
mtu
,
BTap_handler_error
handler_error
,
void
*
handler_error_user
,
int
tun
)
{
ASSERT
(
tun
==
0
||
tun
==
1
)
#ifndef BADVPN_LINUX
return
0
;
#endif
o
->
reactor
=
reactor
;
o
->
handler_error
=
handler_error
;
o
->
handler_error_user
=
handler_error_user
;
o
->
frame_mtu
=
mtu
;
o
->
fd
=
fd
;
// init file descriptor object
BFileDescriptor_Init
(
&
o
->
bfd
,
o
->
fd
,
(
BFileDescriptor_handler
)
fd_handler
,
o
);
if
(
!
BReactor_AddFileDescriptor
(
o
->
reactor
,
&
o
->
bfd
))
{
BLog
(
BLOG_ERROR
,
"BReactor_AddFileDescriptor failed"
);
goto
fail1
;
}
o
->
poll_events
=
0
;
goto
success
;
fail1:
ASSERT_FORCE
(
close
(
o
->
fd
)
==
0
)
fail0:
return
0
;
success:
// init output
PacketRecvInterface_Init
(
&
o
->
output
,
o
->
frame_mtu
,
(
PacketRecvInterface_handler_recv
)
output_handler_recv
,
o
,
BReactor_PendingGroup
(
o
->
reactor
));
// set no output packet
o
->
output_packet
=
NULL
;
DebugError_Init
(
&
o
->
d_err
,
BReactor_PendingGroup
(
o
->
reactor
));
DebugObject_Init
(
&
o
->
d_obj
);
return
1
;
}
#endif
int
BTap_Init2
(
BTap
*
o
,
BReactor
*
reactor
,
struct
BTap_init_data
init_data
,
BTap_handler_error
handler_error
,
void
*
handler_error_user
)
{
ASSERT
(
init_data
.
dev_type
==
BTAP_DEV_TUN
||
init_data
.
dev_type
==
BTAP_DEV_TAP
)
...
...
src/main/jni/badvpn/tuntap/BTap.h
View file @
18e62360
...
...
@@ -107,10 +107,6 @@ typedef struct {
*/
int
BTap_Init
(
BTap
*
o
,
BReactor
*
bsys
,
char
*
devname
,
BTap_handler_error
handler_error
,
void
*
handler_error_user
,
int
tun
)
WARN_UNUSED
;
#ifdef ANDROID
int
BTap_InitWithFD
(
BTap
*
o
,
BReactor
*
bsys
,
int
fd
,
int
mtu
,
BTap_handler_error
handler_error
,
void
*
handler_error_user
,
int
tun
)
WARN_UNUSED
;
#endif
enum
BTap_dev_type
{
BTAP_DEV_TUN
,
BTAP_DEV_TAP
};
enum
BTap_init_type
{
...
...
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