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
269b0486
Unverified
Commit
269b0486
authored
Feb 07, 2020
by
Mygod
Committed by
GitHub
Feb 07, 2020
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Suppress EPERM for bind
parent
1fb529fb
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
6 additions
and
2 deletions
+6
-2
core/src/main/java/com/github/shadowsocks/bg/VpnService.kt
core/src/main/java/com/github/shadowsocks/bg/VpnService.kt
+6
-2
No files found.
core/src/main/java/com/github/shadowsocks/bg/VpnService.kt
View file @
269b0486
...
@@ -29,6 +29,7 @@ import android.net.Network
...
@@ -29,6 +29,7 @@ import android.net.Network
import
android.os.Build
import
android.os.Build
import
android.os.ParcelFileDescriptor
import
android.os.ParcelFileDescriptor
import
android.system.ErrnoException
import
android.system.ErrnoException
import
android.system.OsConstants
import
com.github.shadowsocks.Core
import
com.github.shadowsocks.Core
import
com.github.shadowsocks.VpnRequestActivity
import
com.github.shadowsocks.VpnRequestActivity
import
com.github.shadowsocks.acl.Acl
import
com.github.shadowsocks.acl.Acl
...
@@ -72,8 +73,11 @@ class VpnService : BaseVpnService(), LocalDnsService.Interface {
...
@@ -72,8 +73,11 @@ class VpnService : BaseVpnService(), LocalDnsService.Interface {
DnsResolverCompat
.
bindSocket
(
network
,
fd
)
DnsResolverCompat
.
bindSocket
(
network
,
fd
)
return
@let
true
return
@let
true
}
catch
(
e
:
IOException
)
{
}
catch
(
e
:
IOException
)
{
// suppress ENONET (Machine is not on the network)
when
((
e
.
cause
as
?
ErrnoException
)
?.
errno
)
{
if
((
e
.
cause
as
?
ErrnoException
)
?.
errno
!=
64
)
printLog
(
e
)
// also suppress ENONET (Machine is not on the network)
OsConstants
.
EPERM
,
64
->
e
.
printStackTrace
()
else
->
printLog
(
e
)
}
return
@let
false
return
@let
false
}
catch
(
e
:
ReflectiveOperationException
)
{
}
catch
(
e
:
ReflectiveOperationException
)
{
check
(
Build
.
VERSION
.
SDK_INT
<
23
)
check
(
Build
.
VERSION
.
SDK_INT
<
23
)
...
...
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