diff options
-rw-r--r-- | lib/src/compat.c | 4 | ||||
-rw-r--r-- | lib/src/name.c | 3 | ||||
-rw-r--r-- | libtransport/src/hicn/transport/core/forwarder_interface.h | 2 |
3 files changed, 6 insertions, 3 deletions
diff --git a/lib/src/compat.c b/lib/src/compat.c index d76e17a6d..68f761ac0 100644 --- a/lib/src/compat.c +++ b/lib/src/compat.c @@ -344,7 +344,7 @@ hicn_packet_get_locator (hicn_format_t format, const hicn_header_t * h, return HICN_LIB_ERROR_NOT_IMPLEMENTED; } - memcpy (prefix->address.buffer, locator, ip_prefix_len(prefix)); + memcpy (prefix->address.buffer, locator, ip_address_len(&prefix->address, prefix->family)); return HICN_LIB_ERROR_NONE; } @@ -370,7 +370,7 @@ hicn_packet_set_locator (hicn_format_t format, hicn_header_t * h, return HICN_LIB_ERROR_INVALID_PARAMETER; } - memcpy (locator, prefix->address.buffer, ip_prefix_len(prefix)); + memcpy (locator, prefix->address.buffer, ip_address_len(&prefix->address, prefix->family)); return HICN_LIB_ERROR_NONE; } diff --git a/lib/src/name.c b/lib/src/name.c index 1f1051522..a19971d49 100644 --- a/lib/src/name.c +++ b/lib/src/name.c @@ -95,7 +95,8 @@ hicn_name_create_from_prefix (const ip_prefix_t * prefix, u32 id, return HICN_LIB_ERROR_NOT_IMPLEMENTED; } - memcpy (name->buffer, prefix->address.buffer, ip_prefix_len (prefix)); + memcpy (name->buffer, prefix->address.buffer, + ip_address_len(&prefix->address, prefix->family)); *(u32 *) (name->buffer + name->len) = id; return HICN_LIB_ERROR_NONE; diff --git a/libtransport/src/hicn/transport/core/forwarder_interface.h b/libtransport/src/hicn/transport/core/forwarder_interface.h index 6bcdaafc1..a89ed8a3c 100644 --- a/libtransport/src/hicn/transport/core/forwarder_interface.h +++ b/libtransport/src/hicn/transport/core/forwarder_interface.h @@ -50,7 +50,9 @@ class ForwarderInterface { output_interface_(""), content_store_reserved_(standard_cs_reserved) { inet_address_.family = AF_INET; + inet_address_.len = IPV4_ADDR_LEN; inet6_address_.family = AF_INET6; + inet6_address_.len = IPV6_ADDR_LEN; } public: |