summaryrefslogtreecommitdiff
path: root/lib/prefix.c
diff options
context:
space:
mode:
authorRenato Westphal <renato@opensourcerouting.org>2019-03-02 15:00:46 -0300
committerRenato Westphal <renatowestphal@gmail.com>2019-03-29 11:32:21 -0300
commit8f88441d717c0ded412543cceabf0ddd93ee9f09 (patch)
tree0a460d2da46a5b910535529c92e8db2fa5ff2a74 /lib/prefix.c
parent6a534dcafcb623f1b85b5ee2a13c74faab227ced (diff)
parent700e9faa28bbdc3460e1d7aa109b6e4acaf347b3 (diff)
Merge remote-tracking branch 'frr/master' into rip-vrf
Merge commit to solve a bunch of conflicts with other PRs that were merged in the previous weeks. Signed-off-by: Renato Westphal <renato@opensourcerouting.org>
Diffstat (limited to 'lib/prefix.c')
-rw-r--r--lib/prefix.c11
1 files changed, 6 insertions, 5 deletions
diff --git a/lib/prefix.c b/lib/prefix.c
index 0203301562..80a89cc3c7 100644
--- a/lib/prefix.c
+++ b/lib/prefix.c
@@ -30,6 +30,7 @@
#include "lib_errors.h"
DEFINE_MTYPE_STATIC(LIB, PREFIX, "Prefix")
+DEFINE_MTYPE_STATIC(LIB, PREFIX_FLOWSPEC, "Prefix Flowspec")
/* Maskbit. */
static const uint8_t maskbit[] = {0x00, 0x80, 0xc0, 0xe0, 0xf0,
@@ -820,7 +821,7 @@ const char *prefix_family_str(const struct prefix *p)
}
/* Allocate new prefix_ipv4 structure. */
-struct prefix_ipv4 *prefix_ipv4_new()
+struct prefix_ipv4 *prefix_ipv4_new(void)
{
struct prefix_ipv4 *p;
@@ -865,7 +866,7 @@ int str2prefix_ipv4(const char *str, struct prefix_ipv4 *p)
return ret;
} else {
cp = XMALLOC(MTYPE_TMP, (pnt - str) + 1);
- strncpy(cp, str, pnt - str);
+ memcpy(cp, str, pnt - str);
*(cp + (pnt - str)) = '\0';
ret = inet_aton(cp, &p->prefix);
XFREE(MTYPE_TMP, cp);
@@ -912,7 +913,7 @@ int str2prefix_eth(const char *str, struct prefix_eth *p)
}
cp = XMALLOC(MTYPE_TMP, (pnt - str) + 1);
- strncpy(cp, str, pnt - str);
+ memcpy(cp, str, pnt - str);
*(cp + (pnt - str)) = '\0';
str_addr = cp;
@@ -1029,7 +1030,7 @@ int str2prefix_ipv6(const char *str, struct prefix_ipv6 *p)
int plen;
cp = XMALLOC(MTYPE_TMP, (pnt - str) + 1);
- strncpy(cp, str, pnt - str);
+ memcpy(cp, str, pnt - str);
*(cp + (pnt - str)) = '\0';
ret = inet_pton(AF_INET6, cp, &p->prefix);
XFREE(MTYPE_TMP, cp);
@@ -1359,7 +1360,7 @@ const char *prefix2str(union prefixconstptr pu, char *str, int size)
return str;
}
-struct prefix *prefix_new()
+struct prefix *prefix_new(void)
{
struct prefix *p;