summaryrefslogtreecommitdiffstats
path: root/config.h
diff options
context:
space:
mode:
authorLorenzo Colitti <lorenzo@google.com>2014-10-31 21:54:33 +0900
committerLorenzo Colitti <lorenzo@google.com>2014-11-01 01:17:22 +0900
commit798f9934fca523dfb57136bd185cf6e9460323ad (patch)
tree2173d37b9a340b20d06a339375e9b27a7730b01c /config.h
parent8a41a5d140b3cf56a54bdeef234e89ee12cba0dc (diff)
downloadandroid_external_android-clat-798f9934fca523dfb57136bd185cf6e9460323ad.tar.gz
android_external_android-clat-798f9934fca523dfb57136bd185cf6e9460323ad.tar.bz2
android_external_android-clat-798f9934fca523dfb57136bd185cf6e9460323ad.zip
Use different IPv4 addresses on different clat interfaces.
Previously the code would use 192.0.0.4 on all clat interfaces. This works, but it has the problem when a clat interface goes down, we do not reset TCP connections on its IP address if there is another clat interface up. Fix this by assigning every clat interface its own IP address in 192.0.0.0/29. Bug: 12111730 Change-Id: I28c831acd93b0980efea8e90c1cdf8b607beac68
Diffstat (limited to 'config.h')
-rw-r--r--config.h6
1 files changed, 5 insertions, 1 deletions
diff --git a/config.h b/config.h
index a56d6fc..05b3a5a 100644
--- a/config.h
+++ b/config.h
@@ -21,7 +21,7 @@
#include <netinet/in.h>
#define DEFAULT_IPV4_LOCAL_SUBNET "192.0.0.4"
-
+#define DEFAULT_IPV4_LOCAL_PREFIXLEN "29"
#define DEFAULT_DNS64_DETECTION_HOSTNAME "ipv4only.arpa"
struct clat_config {
@@ -29,6 +29,7 @@ struct clat_config {
struct in6_addr ipv6_local_subnet;
struct in6_addr ipv6_host_id;
struct in_addr ipv4_local_subnet;
+ int16_t ipv4_local_prefixlen;
struct in6_addr plat_subnet;
char *default_pdp_interface;
char *plat_from_dns64_hostname;
@@ -39,6 +40,9 @@ extern struct clat_config Global_Clatd_Config;
int read_config(const char *file, const char *uplink_interface, const char *plat_prefix,
unsigned net_id);
void config_generate_local_ipv6_subnet(struct in6_addr *interface_ip);
+in_addr_t config_select_ipv4_address(const struct in_addr *ip, int16_t prefixlen);
int ipv6_prefix_equal(struct in6_addr *a1, struct in6_addr *a2);
+typedef int (*addr_free_func)(in_addr_t addr);
+
#endif /* __CONFIG_H__ */