Skip to content

Commit

Permalink
Fix UDP forward
Browse files Browse the repository at this point in the history
  • Loading branch information
madeye committed Aug 7, 2016
1 parent 03c8575 commit 4817539
Show file tree
Hide file tree
Showing 3 changed files with 15 additions and 13 deletions.
2 changes: 1 addition & 1 deletion kcptun/go
Submodule go updated 1 files
+5 −3 src/net/sock_posix.go
4 changes: 2 additions & 2 deletions src/main/AndroidManifest.xml
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:tools="http://schemas.android.com/tools" package="com.github.shadowsocks"
android:versionCode="143"
android:versionName="3.0.1">
android:versionCode="144"
android:versionName="3.0.2">

<uses-permission android:name="android.permission.INTERNET"/>
<uses-permission android:name="android.permission.ACCESS_NETWORK_STATE"/>
Expand Down
22 changes: 12 additions & 10 deletions src/main/scala/com/github/shadowsocks/ShadowsocksVpnService.scala
Original file line number Diff line number Diff line change
Expand Up @@ -182,25 +182,25 @@ class ShadowsocksVpnService extends VpnService with BaseService {
/** Called when the activity is first created. */
def handleConnection: Boolean = {

if (!profile.udpdns) {
startDnsDaemon()
startDnsTunnel()
val fd = startVpn()
if (!sendFd(fd)) return false

if (profile.kcp) {
startKcptunDaemon()
}

startShadowsocksDaemon()

if (profile.udpdns) {
if (profile.udpdns && profile.kcp) {
startShadowsocksUDPDaemon()
}

val fd = startVpn()
val ret = sendFd(fd)

if (ret && profile.kcp) {
startKcptunDaemon()
if (!profile.udpdns) {
startDnsDaemon()
startDnsTunnel()
}

ret
true
}

def startKcptunDaemon() {
Expand Down Expand Up @@ -274,6 +274,8 @@ class ShadowsocksVpnService extends VpnService with BaseService {

if (profile.auth) cmd += "-A"

if (profile.udpdns && !profile.kcp) cmd += "-u"

if (profile.route != Route.ALL) {
cmd += "--acl"
cmd += (getApplicationInfo.dataDir + "/acl.list")
Expand Down

0 comments on commit 4817539

Please sign in to comment.