cleanup - config_item_int16() & DEFAULT_IPV4_LOCAL_PREFIXLEN
Test:
git grep 'config_item_int16|DEFAULT_IPV4_LOCAL_PREFIXLEN'
comes up empty
Bug: 144730808
Test: atest clatd_test netd_integration_test
Signed-off-by: Maciej Żenczykowski <maze@google.com>
Change-Id: I71716cdcba382bc5fb1efa5000189f63a57015c9
diff --git a/config.c b/config.c
index 4be61a7..bcf77ba 100644
--- a/config.c
+++ b/config.c
@@ -35,49 +35,6 @@
struct clat_config Global_Clatd_Config;
-/* function: config_item_int16_t
- * locates the config item, parses the integer, and returns the pointer ret_val_ptr, or NULL on
- * failure
- * root - parsed configuration
- * item_name - name of config item to locate
- * defaultvar - value to use if config item isn't present
- * ret_val_ptr - pointer for return value storage
- */
-int16_t *config_item_int16_t(cnode *root, const char *item_name, const char *defaultvar,
- int16_t *ret_val_ptr) {
- const char *tmp;
- char *endptr;
- long int conf_int;
-
- if (!(tmp = config_str(root, item_name, defaultvar))) {
- logmsg(ANDROID_LOG_FATAL, "%s config item needed", item_name);
- return NULL;
- }
-
- errno = 0;
- conf_int = strtol(tmp, &endptr, 10);
- if (errno > 0) {
- logmsg(ANDROID_LOG_FATAL, "%s config item is not numeric: %s (error=%s)", item_name, tmp,
- strerror(errno));
- return NULL;
- }
- if (endptr == tmp || *tmp == '\0') {
- logmsg(ANDROID_LOG_FATAL, "%s config item is not numeric: %s", item_name, tmp);
- return NULL;
- }
- if (*endptr != '\0') {
- logmsg(ANDROID_LOG_FATAL, "%s config item contains non-numeric characters: %s", item_name,
- endptr);
- return NULL;
- }
- if (conf_int > INT16_MAX || conf_int < INT16_MIN) {
- logmsg(ANDROID_LOG_FATAL, "%s config item is too big/small: %d", item_name, conf_int);
- return NULL;
- }
- *ret_val_ptr = conf_int;
- return ret_val_ptr;
-}
-
/* function: config_item_ip
* locates the config item, parses the ipv4 address, and returns the pointer ret_val_ptr, or NULL on
* failure
@@ -169,9 +126,7 @@
&Global_Clatd_Config.ipv4_local_subnet))
goto failed;
- if (!config_item_int16_t(root, "ipv4_local_prefixlen", DEFAULT_IPV4_LOCAL_PREFIXLEN,
- &Global_Clatd_Config.ipv4_local_prefixlen))
- goto failed;
+ Global_Clatd_Config.ipv4_local_prefixlen = 29;
return 1;
diff --git a/config.h b/config.h
index 9231906..555b968 100644
--- a/config.h
+++ b/config.h
@@ -22,7 +22,6 @@
#include <netinet/in.h>
#define DEFAULT_IPV4_LOCAL_SUBNET "192.0.0.4"
-#define DEFAULT_IPV4_LOCAL_PREFIXLEN "29"
struct clat_config {
struct in6_addr ipv6_local_subnet;