diff options
author | Angelo Mantellini <manangel@cisco.com> | 2021-04-30 12:26:57 +0200 |
---|---|---|
committer | Angelo Mantellini <angelo.mantellini@cisco.com> | 2021-04-30 14:54:00 +0200 |
commit | 07133ac060c2af721941f7b47c52c075df3168ba (patch) | |
tree | a3a618442fc9f1adb5f1cf2e3d442c70fd787d2b /libtransport/src/core/prefix.cc | |
parent | 39e15ebb3805efb6c71a1dd16f18061cd86487cf (diff) |
[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 <angelo.mantellini@cisco.com>
Diffstat (limited to 'libtransport/src/core/prefix.cc')
-rw-r--r-- | libtransport/src/core/prefix.cc | 8 |
1 files changed, 4 insertions, 4 deletions
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<Sockaddr> 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); |