summaryrefslogtreecommitdiffstats
path: root/services/jni
diff options
context:
space:
mode:
authorChia-chi Yeh <chiachi@android.com>2011-06-13 15:26:51 -0700
committerChia-chi Yeh <chiachi@android.com>2011-06-13 15:26:51 -0700
commit6224b5ec3857d78e92bbc21075717eaa228ff891 (patch)
tree3486d738e0c87eee35b824a8e020a565eb54f96f /services/jni
parent3663227a8be5c6c05bf4adadc378fd69b7ae814c (diff)
downloadframeworks_base-6224b5ec3857d78e92bbc21075717eaa228ff891.zip
frameworks_base-6224b5ec3857d78e92bbc21075717eaa228ff891.tar.gz
frameworks_base-6224b5ec3857d78e92bbc21075717eaa228ff891.tar.bz2
VPN: set IFF_NO_PI on TUN interface.
Packet info header (struct tun_pi) was required to support IPv6 in kernel prior to 2.6.26. Setting IFF_NO_PI will remove the header from the packets sent/recieved via TUN file descriptor, so now they are just raw IP packets. Change-Id: I0b4ae9db23d3bc10995a00eb053527b499ad6eb6
Diffstat (limited to 'services/jni')
-rw-r--r--services/jni/com_android_server_connectivity_Vpn.cpp2
1 files changed, 1 insertions, 1 deletions
diff --git a/services/jni/com_android_server_connectivity_Vpn.cpp b/services/jni/com_android_server_connectivity_Vpn.cpp
index a968cd2..7953727 100644
--- a/services/jni/com_android_server_connectivity_Vpn.cpp
+++ b/services/jni/com_android_server_connectivity_Vpn.cpp
@@ -68,7 +68,7 @@ static int create_interface(int mtu, char *name, int *index)
memset(&ifr4, 0, sizeof(ifr4));
// Allocate interface.
- ifr4.ifr_flags = IFF_TUN;
+ ifr4.ifr_flags = IFF_TUN | IFF_NO_PI;
if (ioctl(tun, TUNSETIFF, &ifr4)) {
LOGE("Cannot allocate TUN: %s", strerror(errno));
goto error;