summaryrefslogtreecommitdiffstats
path: root/libtransport/src
diff options
context:
space:
mode:
authorMauro Sardara <msardara@cisco.com>2021-02-04 13:37:30 +0100
committerMauro Sardara <msardara@cisco.com>2021-02-05 10:25:17 +0000
commitdb76bbc76c8d2cb2d817df8c9233937d230a1ff2 (patch)
tree4f09c597a35be748a9d6c00996e2f1b02894c944 /libtransport/src
parent6e1907b0d03a5e7eb6a76e9f17de05799202df62 (diff)
[HICN-681] Remove compilation warning in ubuntu 20.04 jobs.
Signed-off-by: Mauro Sardara <msardara@cisco.com> Change-Id: Id9666941d2a84d5deb75716a410abe9305923531 Signed-off-by: Mauro Sardara <msardara@cisco.com>
Diffstat (limited to 'libtransport/src')
-rw-r--r--libtransport/src/core/tcp_socket_connector.cc6
1 files changed, 4 insertions, 2 deletions
diff --git a/libtransport/src/core/tcp_socket_connector.cc b/libtransport/src/core/tcp_socket_connector.cc
index 20b3d6ce6..f38bd2bef 100644
--- a/libtransport/src/core/tcp_socket_connector.cc
+++ b/libtransport/src/core/tcp_socket_connector.cc
@@ -33,6 +33,8 @@ namespace {
class NetworkMessage {
public:
static constexpr std::size_t fixed_header_length = 10;
+ static constexpr std::uint8_t ccnx_flag = 102;
+ static constexpr std::size_t ccnx_packet_length = 44;
static std::size_t decodeHeader(const uint8_t *packet) {
// General checks
@@ -40,9 +42,9 @@ class NetworkMessage {
uint8_t first_byte = packet[0];
uint8_t ip_format = (packet[0] & 0xf0) >> 4;
- if (TRANSPORT_EXPECT_FALSE(first_byte == 102)) {
+ if (TRANSPORT_EXPECT_FALSE(first_byte == ccnx_flag)) {
// Get packet length
- return 44;
+ return ccnx_packet_length;
} else if (TRANSPORT_EXPECT_TRUE(ip_format == 6 || ip_format == 4)) {
Packet::Format format = Packet::getFormatFromBuffer(packet);
return Packet::getHeaderSizeFromBuffer(format, packet) +