From 07133ac060c2af721941f7b47c52c075df3168ba Mon Sep 17 00:00:00 2001 From: Angelo Mantellini Date: Fri, 30 Apr 2021 12:26:57 +0200 Subject: [HICN-703] Update windows-sdk and hicn code Signed-off-by: Angelo Mantellini <@ngelo.mantellini@cisco.com> Change-Id: I05e4c92ce7de3640f0272afae127e1377862bd3e Signed-off-by: Angelo Mantellini --- libtransport/src/core/prefix.cc | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) (limited to 'libtransport/src/core/prefix.cc') diff --git a/libtransport/src/core/prefix.cc b/libtransport/src/core/prefix.cc index 1e2b2ed9d..d598cff75 100644 --- a/libtransport/src/core/prefix.cc +++ b/libtransport/src/core/prefix.cc @@ -69,7 +69,7 @@ Prefix::Prefix(const core::Name &content_name, uint16_t prefix_length) { } ip_prefix_ = content_name.toIpAddress(); - ip_prefix_.len = prefix_length; + ip_prefix_.len = (u8)prefix_length; ip_prefix_.family = family; } @@ -95,7 +95,7 @@ void Prefix::buildPrefix(std::string &prefix, uint16_t prefix_length, throw errors::InvalidIpAddressException(); } - ip_prefix_.len = prefix_length; + ip_prefix_.len = (u8)prefix_length; ip_prefix_.family = family; } @@ -123,7 +123,7 @@ std::unique_ptr Prefix::toSockaddr() const { uint16_t Prefix::getPrefixLength() const { return ip_prefix_.len; } Prefix &Prefix::setPrefixLength(uint16_t prefix_length) { - ip_prefix_.len = prefix_length; + ip_prefix_.len = (u8)prefix_length; return *this; } @@ -228,7 +228,7 @@ Name Prefix::getRandomName() const { size_t size = (size_t)ceil((float)addr_len / 8.0); uint8_t *buffer = (uint8_t *)malloc(sizeof(uint8_t) * size); - RAND_bytes(buffer, size); + RAND_bytes(buffer, (int)size); int j = 0; for (uint8_t i = (uint8_t)ceil((float)ip_prefix_.len / 8.0); -- cgit 1.2.3-korg