From db76bbc76c8d2cb2d817df8c9233937d230a1ff2 Mon Sep 17 00:00:00 2001 From: Mauro Sardara Date: Thu, 4 Feb 2021 13:37:30 +0100 Subject: [HICN-681] Remove compilation warning in ubuntu 20.04 jobs. Signed-off-by: Mauro Sardara Change-Id: Id9666941d2a84d5deb75716a410abe9305923531 Signed-off-by: Mauro Sardara --- hicn-plugin/src/CMakeLists.txt | 4 ++-- libtransport/src/core/tcp_socket_connector.cc | 6 ++++-- scripts/functions.sh | 18 +++++++----------- 3 files changed, 13 insertions(+), 15 deletions(-) diff --git a/hicn-plugin/src/CMakeLists.txt b/hicn-plugin/src/CMakeLists.txt index a3480c21d..14eb23d70 100644 --- a/hicn-plugin/src/CMakeLists.txt +++ b/hicn-plugin/src/CMakeLists.txt @@ -178,9 +178,9 @@ endif (NOT CMAKE_BUILD_TYPE) SET(HICN_INSTALL_PREFIX ${CMAKE_INSTALL_PREFIX}/${CMAKE_INSTALL_LIBDIR} CACHE STRING "hicn_install_prefix") if (CMAKE_BUILD_TYPE STREQUAL "Release") - set(CMAKE_C_FLAGS_RELEASE "${CMAKE_C_FLAGS_RELEASE} -Wall -march=native -O3 -g") + set(CMAKE_C_FLAGS_RELEASE "${CMAKE_C_FLAGS_RELEASE} -Wall -march=native -O3 -g -Wno-address-of-packed-member") elseif (CMAKE_BUILD_TYPE STREQUAL "Debug") - set(CMAKE_C_FLAGS_DEBUG "${CMAKE_C_FLAGS_DEBUG} -Wall -march=native -O0 -g") + set(CMAKE_C_FLAGS_DEBUG "${CMAKE_C_FLAGS_DEBUG} -Wall -march=native -O0 -g -Wno-address-of-packed-member") add_definitions(-DCLIB_DEBUG -fPIC -fstack-protector-all) endif() 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) + diff --git a/scripts/functions.sh b/scripts/functions.sh index adf3fd1fc..19b69e302 100644 --- a/scripts/functions.sh +++ b/scripts/functions.sh @@ -50,7 +50,6 @@ DEPS_UBUNTU=("build-essential" "libasio-dev" "libconfig-dev" "libcurl4-openssl-dev" - "collectd-dev" "libevent-dev" "libssl-dev" "ninja-build" @@ -78,20 +77,17 @@ DEPS_CENTOS=("vpp-devel-${VPP_VERSION_RPM}" "rpm-build") LATEST_EPEL_REPO="http://dl.fedoraproject.org/pub/epel/epel-release-latest-7.noarch.rpm" -COLLECTD_SOURCE="https://storage.googleapis.com/collectd-tarballs/collectd-5.9.2.tar.bz2" +COLLECTD_SOURCE="https://github.com/collectd/collectd/releases/download/collectd-5.12.0/collectd-5.12.0.tar.bz2" function install_collectd_headers() { - DISTRIB_ID=${ID} - if [ "${DISTRIB_ID}" == "centos" ]; then - curl -OL ${COLLECTD_SOURCE} - tar -xf collectd-5.9.2.tar.bz2 + curl -OL ${COLLECTD_SOURCE} + tar -xf collectd-5.12.0.tar.bz2 - pushd collectd-5.9.2 - ./configure && make -j$(nproc) - popd + pushd collectd-5.12.0 + ./configure && make -j$(nproc) + popd - export COLLECTD_HOME=${PWD}/collectd-5.9.2/src - fi + export COLLECTD_HOME=${PWD}/collectd-5.12.0/src } function install_cmake() { -- cgit 1.2.3-korg