summaryrefslogtreecommitdiffstats
path: root/config.c
diff options
context:
space:
mode:
authorJP Abgrall <jpa@google.com>2013-12-20 14:51:26 -0800
committerJP Abgrall <jpa@google.com>2013-12-26 12:29:11 -0800
commit4e0dd83686869c292e162dc76992863d3f3a3c38 (patch)
treea63ff9ab95c72bc736064bbc46bd0255df7d8c61 /config.c
parentc9f4c89da6c76ebc59a0ec1047853a13ce5f5d96 (diff)
downloadplatform_external_android-clat-4e0dd83686869c292e162dc76992863d3f3a3c38.tar.gz
platform_external_android-clat-4e0dd83686869c292e162dc76992863d3f3a3c38.tar.bz2
platform_external_android-clat-4e0dd83686869c292e162dc76992863d3f3a3c38.zip
Add ip6 dummy address to keep data usage stats consistent.
Because of the way the tunnel pumps packets into the networking stack, the netfilter xt_qtaguid module can't track stats accurately: the totals don't add up. With "clat" having an ip address, qtaguid will track stats against it, which then can be deducted from the external iface. Bug: 11687690 Change-Id: I22ebf26dd9249e821da87665d2bfb0e54d3cdf64
Diffstat (limited to 'config.c')
-rw-r--r--config.c4
1 files changed, 4 insertions, 0 deletions
diff --git a/config.c b/config.c
index e7ec80e..61a4ebb 100644
--- a/config.c
+++ b/config.c
@@ -255,6 +255,9 @@ int read_config(const char *file, const char *uplink_interface, const char *plat
if(!config_item_ip(root, "ipv4_local_subnet", DEFAULT_IPV4_LOCAL_SUBNET, &Global_Clatd_Config.ipv4_local_subnet))
goto failed;
+ if(!config_item_ip6(root, "ipv6_local_address", DEFAULT_IPV6_LOCAL_ADDRESS, &Global_Clatd_Config.ipv6_local_address))
+ goto failed;
+
if(plat_prefix) { // plat subnet is coming from the command line
if(inet_pton(AF_INET6, plat_prefix, &Global_Clatd_Config.plat_subnet) <= 0) {
logmsg(ANDROID_LOG_FATAL,"invalid IPv6 address specified for plat prefix: %s", plat_prefix);
@@ -295,6 +298,7 @@ void dump_config() {
logmsg(ANDROID_LOG_DEBUG,"mtu = %d",Global_Clatd_Config.mtu);
logmsg(ANDROID_LOG_DEBUG,"ipv4mtu = %d",Global_Clatd_Config.ipv4mtu);
+ logmsg(ANDROID_LOG_DEBUG,"ipv6_local_address = %s",inet_ntop(AF_INET6, &Global_Clatd_Config.ipv6_local_address, charbuffer, sizeof(charbuffer)));
logmsg(ANDROID_LOG_DEBUG,"ipv6_local_subnet = %s",inet_ntop(AF_INET6, &Global_Clatd_Config.ipv6_local_subnet, charbuffer, sizeof(charbuffer)));
logmsg(ANDROID_LOG_DEBUG,"ipv4_local_subnet = %s",inet_ntop(AF_INET, &Global_Clatd_Config.ipv4_local_subnet, charbuffer, sizeof(charbuffer)));
logmsg(ANDROID_LOG_DEBUG,"plat_subnet = %s",inet_ntop(AF_INET6, &Global_Clatd_Config.plat_subnet, charbuffer, sizeof(charbuffer)));