summaryrefslogtreecommitdiffstats
path: root/services/jni
diff options
context:
space:
mode:
authorChia-chi Yeh <chiachi@android.com>2011-06-30 22:59:18 -0700
committerChia-chi Yeh <chiachi@android.com>2011-06-30 22:59:18 -0700
commit9c0835fd7262c50cf6a91380df1654daffe2c977 (patch)
treeb7c3f42c37f8b3d71161b9fc700e5ff7b2e11d15 /services/jni
parent7d1279b30911ed1e5d8f7e195176fd98ee64454d (diff)
downloadframeworks_base-9c0835fd7262c50cf6a91380df1654daffe2c977.zip
frameworks_base-9c0835fd7262c50cf6a91380df1654daffe2c977.tar.gz
frameworks_base-9c0835fd7262c50cf6a91380df1654daffe2c977.tar.bz2
VPN: correct the netmask for IPv4.
Change-Id: Id6e955af129d55120676d0d9cfe75388671aa367
Diffstat (limited to 'services/jni')
-rw-r--r--services/jni/com_android_server_connectivity_Vpn.cpp4
1 files changed, 2 insertions, 2 deletions
diff --git a/services/jni/com_android_server_connectivity_Vpn.cpp b/services/jni/com_android_server_connectivity_Vpn.cpp
index a0ea92b..62d7636 100644
--- a/services/jni/com_android_server_connectivity_Vpn.cpp
+++ b/services/jni/com_android_server_connectivity_Vpn.cpp
@@ -244,7 +244,7 @@ static int set_routes(const char *name, const char *routes)
break;
}
- in_addr_t mask = prefix ? (~0 << (32 - prefix)) : 1;
+ in_addr_t mask = prefix ? (~0 << (32 - prefix)) : 0x80000000;
*as_in_addr(&rt4.rt_genmask) = htonl(mask);
if (ioctl(inet4, SIOCADDRT, &rt4) && errno != EEXIST) {
count = (errno == EINVAL) ? BAD_ARGUMENT : SYSTEM_ERROR;
@@ -394,7 +394,7 @@ static jint setRoutes(JNIEnv *env, jobject thiz, jstring jName,
}
count = set_routes(name, routes);
if (count < 0) {
- throwException(env, count, "Cannot set address");
+ throwException(env, count, "Cannot set route");
count = -1;
}