aboutsummaryrefslogtreecommitdiffstats
path: root/lib
diff options
context:
space:
mode:
Diffstat (limited to 'lib')
-rw-r--r--lib/includes/hicn/policy.h2
-rw-r--r--lib/includes/hicn/util/log.h2
-rw-r--r--lib/src/util/ip_address.c11
3 files changed, 7 insertions, 8 deletions
diff --git a/lib/includes/hicn/policy.h b/lib/includes/hicn/policy.h
index 12f8c1e12..73d281cd6 100644
--- a/lib/includes/hicn/policy.h
+++ b/lib/includes/hicn/policy.h
@@ -104,7 +104,7 @@ foreach_policy_tag
return POLICY_TAG_N + 1;
}
-#define MAXSZ_POLICY_TAGS_ POLICY_TAG_N
+#define MAXSZ_POLICY_TAGS_ POLICY_TAG_N + 1
#define MAXSZ_POLICY_TAGS MAXSZ_POLICY_TAGS_ + 1
/* POLICY STATE */
diff --git a/lib/includes/hicn/util/log.h b/lib/includes/hicn/util/log.h
index f1cafba47..26d7d9418 100644
--- a/lib/includes/hicn/util/log.h
+++ b/lib/includes/hicn/util/log.h
@@ -34,7 +34,7 @@ typedef struct {
} log_conf_t;
#define DEFAULT_LOG_CONF { \
- .log_level = LOG_DEBUG, \
+ .log_level = LOG_INFO, \
.debug = 0, \
.log_file = NULL, \
};
diff --git a/lib/src/util/ip_address.c b/lib/src/util/ip_address.c
index 2b7c69bb5..8bbb2bf5d 100644
--- a/lib/src/util/ip_address.c
+++ b/lib/src/util/ip_address.c
@@ -145,19 +145,18 @@ ip_address_snprintf(char * s, size_t size, const ip_address_t * ip_address, int
if (size <= INET_ADDRSTRLEN)
return -1;
rc = inet_ntop (AF_INET, ip_address->v4.buffer, s, INET_ADDRSTRLEN);
- if (!rc)
- return -1;
- return INET_ADDRSTRLEN;
+ break;
case AF_INET6:
if (size <= INET6_ADDRSTRLEN)
return -1;
rc = inet_ntop (AF_INET6, ip_address->v6.buffer, s, INET6_ADDRSTRLEN);
- if (!rc)
- return -1;
- return INET6_ADDRSTRLEN;
+ break;
default:
return -1;
}
+ if (!rc)
+ return -1;
+ return strlen(s);
}
int