summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorandroid-build-team Robot <android-build-team-robot@google.com>2019-12-01 00:12:57 +0000
committerandroid-build-team Robot <android-build-team-robot@google.com>2019-12-01 00:12:57 +0000
commit23591931427b6d188873dc3c0157827f13961e59 (patch)
treeacc6670b3483564d1fbc1d1ce7cf5cdad7b0cad2
parenta568da52913e972b8bdfb193eb6d960aafb5094e (diff)
parent50dd0b5a7fa887ce5ae55bb5c29d4018c67038a6 (diff)
downloadplatform_external_android-clat-23591931427b6d188873dc3c0157827f13961e59.tar.gz
platform_external_android-clat-23591931427b6d188873dc3c0157827f13961e59.tar.bz2
platform_external_android-clat-23591931427b6d188873dc3c0157827f13961e59.zip
Snap for 6041582 from 50dd0b5a7fa887ce5ae55bb5c29d4018c67038a6 to rvc-release
Change-Id: Iaa1fb902f63066c0af9e1675aea3c85ea85e2150
-rw-r--r--clatd.conf2
-rw-r--r--config.c20
-rw-r--r--config.h3
3 files changed, 4 insertions, 21 deletions
diff --git a/clatd.conf b/clatd.conf
index ff80975..aef9c75 100644
--- a/clatd.conf
+++ b/clatd.conf
@@ -14,8 +14,6 @@ ipv4_local_prefixlen 29
# get the plat_subnet from dns lookups (requires DNS64)
plat_from_dns64 yes
-# hostname to use to lookup plat subnet. must contain only A records
-plat_from_dns64_hostname ipv4only.arpa
# plat subnet to send ipv4 traffic to. This is a /96 subnet.
# This setting only makes sense with: plat_from_dns64 no
diff --git a/config.c b/config.c
index c370770..3ea510d 100644
--- a/config.c
+++ b/config.c
@@ -150,16 +150,6 @@ struct in6_addr *config_item_ip6(cnode *root, const char *item_name, const char
return ret_val_ptr;
}
-/* function: free_config
- * frees the memory used by the global config variable
- */
-void free_config() {
- if (Global_Clatd_Config.plat_from_dns64_hostname) {
- free(Global_Clatd_Config.plat_from_dns64_hostname);
- Global_Clatd_Config.plat_from_dns64_hostname = NULL;
- }
-}
-
/* function: ipv6_prefix_equal
* compares the prefixes two ipv6 addresses. assumes the prefix lengths are both /64.
* a1 - first address
@@ -180,7 +170,7 @@ void dns64_detection(unsigned net_id) {
backoff_sleep = 1;
while (1) {
- status = plat_prefix(Global_Clatd_Config.plat_from_dns64_hostname, net_id, &tmp_ptr);
+ status = plat_prefix(DNS64_DETECTION_HOSTNAME, net_id, &tmp_ptr);
if (status > 0) {
memcpy(&Global_Clatd_Config.plat_subnet, &tmp_ptr, sizeof(struct in6_addr));
return;
@@ -328,9 +318,9 @@ int read_config(const char *file, const char *uplink_interface, const char *plat
Global_Clatd_Config.default_pdp_interface = strdup(uplink_interface);
if (!Global_Clatd_Config.default_pdp_interface) goto failed;
- if (!config_item_int16_t(root, "mtu", "-1", &Global_Clatd_Config.mtu)) goto failed;
+ Global_Clatd_Config.mtu = -1;
- if (!config_item_int16_t(root, "ipv4mtu", "-1", &Global_Clatd_Config.ipv4mtu)) goto failed;
+ Global_Clatd_Config.ipv4mtu = -1;
if (!config_item_ip(root, "ipv4_local_subnet", DEFAULT_IPV4_LOCAL_SUBNET,
&Global_Clatd_Config.ipv4_local_subnet))
@@ -357,9 +347,6 @@ int read_config(const char *file, const char *uplink_interface, const char *plat
} else {
free(tmp_ptr);
- if (!(Global_Clatd_Config.plat_from_dns64_hostname =
- config_item_str(root, "plat_from_dns64_hostname", DEFAULT_DNS64_DETECTION_HOSTNAME)))
- goto failed;
dns64_detection(net_id);
}
}
@@ -381,7 +368,6 @@ int read_config(const char *file, const char *uplink_interface, const char *plat
failed:
free(root);
- free_config();
return 0;
}
diff --git a/config.h b/config.h
index e521b74..88c632a 100644
--- a/config.h
+++ b/config.h
@@ -23,7 +23,7 @@
#define DEFAULT_IPV4_LOCAL_SUBNET "192.0.0.4"
#define DEFAULT_IPV4_LOCAL_PREFIXLEN "29"
-#define DEFAULT_DNS64_DETECTION_HOSTNAME "ipv4only.arpa"
+#define DNS64_DETECTION_HOSTNAME "ipv4only.arpa"
struct clat_config {
int16_t mtu, ipv4mtu;
@@ -33,7 +33,6 @@ struct clat_config {
int16_t ipv4_local_prefixlen;
struct in6_addr plat_subnet;
char *default_pdp_interface;
- char *plat_from_dns64_hostname;
int use_dynamic_iid;
};