From 3791fc0ee6b3280e1b0da177477011009ef2eede Mon Sep 17 00:00:00 2001 From: Matias Fontanini Date: Thu, 2 Apr 2015 23:02:28 -0700 Subject: [PATCH] Fix ICMPv6 issue on big endian. --- src/icmpv6.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/icmpv6.cpp b/src/icmpv6.cpp index 00a1fac..149ffe2 100644 --- a/src/icmpv6.cpp +++ b/src/icmpv6.cpp @@ -499,8 +499,8 @@ void ICMPv6::handover_key_reply(const handover_key_reply_type &value) { std::vector buffer(data_size + padding); buffer[0] = padding; buffer[1] = value.AT << 4; - uint32_t tmp_lifetime = Endian::host_to_be(value.lifetime); - std::memcpy(&buffer[2], &tmp_lifetime, sizeof(uint32_t)); + uint16_t tmp_lifetime = Endian::host_to_be(value.lifetime); + std::memcpy(&buffer[2], &tmp_lifetime, sizeof(uint16_t)); // copy the key, and fill with padding std::fill( std::copy(value.key.begin(), value.key.end(), buffer.begin() + 2 + sizeof(uint16_t)),