-
Notifications
You must be signed in to change notification settings - Fork 369
Trouble with UDP #9
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Comments
I believe this is a bug in the Android VPN: https://code.google.com/p/android/issues/detail?id=64819. UDP packets are not transmitted properly because the source IP address is not correctly rewritten. My pull request attempts to fix this: #4 |
I tried the patch suggested. DNS is working now and moves further. Thanks. A few observations.
04-28 09:54:38.647 22072-22212/xyz.hexene.localvpn W/VPNRunnable: Unknown packet type
04-28 09:54:38.017 22072-22211/xyz.hexene.localvpn E/TCPOutput: Network write error: 216.58.216.162:443:37013 |
|
Hi Mohamed, Thanks for sharing your thoughts. So on Android app level without root access, only TCP and UDP packets can be forwarded. Do you see any possibility to restrict the packet capture to only those initiated by other Apps? Maybe through route setup or some sort of packet filter? Thanks. |
Apologies for the delay. With root access, yes, packet filters can be set up directly (using iptables, etc.). Please see adblockplusandroid for an example. In the absence of root, the approach used in LocalVPN is the only one I'm aware of. The packets generated by other apps will be forwarded to LocalVPN (through VpnService) from where it could be captured/filtered. Hope this answers your question. |
hey @hexene , |
Uh oh!
There was an error while loading. Please reload this page.
Hi Mohamed,
Thanks so much for sharing your work. I am a newbie to both Android and Java, but learning as I read your code. So this could very well be my issue.
I built an apk image with Android Studio 2.1RC and ran on ASUS (4.1.1) tablet with USB debugging enabled and connected to my Ubuntu box where Android Studio is running.
I can see logcat output. I have added more Log.i() into both TCP/UDP input/output to track.
With LocalVPN started, UDP packets to DNS server (port 53) are captured, but no reply packet is seen.
With LocalVPN stop, Web browing works fine. So I think it is not DNS server connectivity issue.
I assume this should work. Thanks for any suggestion that you may have.
Here is a part of logcat output.
04-27 11:23:43.486 29098-29189/xyz.hexene.localvpn I/UDPOutput: UDP out:208.67.220.220:53:24941
04-27 11:23:43.486 29098-29189/xyz.hexene.localvpn I/UDPOutput: packet=Packet{ip4Header=IP4Header{version=4, IHL=5, typeOfService=0, totalLength=62, identificationAndFlagsAndFragmentOffset=-1001308160, TTL=64, protocol=17:UDP, headerChecksum=48955, sourceAddress=10.0.0.2, destinationAddress=208.67.220.220}, udpHeader=UDPHeader{sourcePort=24941, destinationPort=53, length=42, checksum=500}, payloadSize=34}
04-27 11:23:43.506 29098-29188/xyz.hexene.localvpn I/UDPInput: UDP in sleep 10
04-27 11:23:43.536 29098-29189/xyz.hexene.localvpn I/UDPOutput: UDP out write:208.67.220.220:53:24941
04-27 11:23:43.566 29098-29188/xyz.hexene.localvpn I/UDPInput: UDP in sleep 10
Thanks.
-chang
The text was updated successfully, but these errors were encountered: