diff options
| -rw-r--r-- | clatd.conf | 2 | ||||
| -rw-r--r-- | config.c | 20 | ||||
| -rw-r--r-- | config.h | 3 |
3 files changed, 4 insertions, 21 deletions
@@ -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 @@ -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; } @@ -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; }; |
