From 43980f3096655df2b2ecec50e700dd6989b0e0d6 Mon Sep 17 00:00:00 2001 From: michele papalini Date: Tue, 10 Dec 2019 13:40:16 +0100 Subject: [HICN-442] new forwarding strategy Signed-off-by: michele papalini Change-Id: I62c03bddedc83e523fc60f4b50d2c69e38b50318 Signed-off-by: Angelo Mantellini Signed-off-by: michele papalini --- lib/src/name.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) (limited to 'lib') diff --git a/lib/src/name.c b/lib/src/name.c index a623341fe..6c7945a18 100644 --- a/lib/src/name.c +++ b/lib/src/name.c @@ -83,17 +83,18 @@ hicn_name_create_from_ip_prefix (const ip_prefix_t * prefix, u32 id, name->type = HNT_CONTIGUOUS_V4; memcpy (name->buffer, prefix->address.v4.buffer, ip_address_len(prefix->family)); + name->len = IPV4_ADDR_LEN; break; case AF_INET6: name->type = HNT_CONTIGUOUS_V6; memcpy (name->buffer, prefix->address.v6.buffer, ip_address_len(prefix->family)); + name->len = IPV6_ADDR_LEN; break; default: return HICN_LIB_ERROR_INVALID_IP_ADDRESS; } - name->len = (u8) (prefix->len); *(u32 *) (name->buffer + name->len) = id; return HICN_LIB_ERROR_NONE; -- cgit 1.2.3-korg