summaryrefslogtreecommitdiffstats
path: root/VNFs/DPPD-PROX/prox_compat.h
diff options
context:
space:
mode:
authorXavier Simonart <xavier.simonart@intel.com>2019-08-13 10:14:32 -0400
committerPatrice Buriez <patrice.buriez@intel.com>2019-10-08 19:21:34 +0000
commitfb0c44a8e62de7cf06a1ad0c025ac7ecb39cad27 (patch)
tree4eca4ee386a0de23dc1028a37d90ce2c731f1798 /VNFs/DPPD-PROX/prox_compat.h
parentd3552eafaca34771734258f3ff6f4f5f819e72bd (diff)
Support for recent GCC compiler
This is required for instance on gcc (GCC) 8.2.1 20180905 Signed-off-by: Xavier Simonart <xavier.simonart@intel.com> Change-Id: Id86de5d39d77c5cbf168cc51434f436f84376a4c
Diffstat (limited to 'VNFs/DPPD-PROX/prox_compat.h')
-rw-r--r--VNFs/DPPD-PROX/prox_compat.h11
1 files changed, 11 insertions, 0 deletions
diff --git a/VNFs/DPPD-PROX/prox_compat.h b/VNFs/DPPD-PROX/prox_compat.h
index 3ad04140..7564f294 100644
--- a/VNFs/DPPD-PROX/prox_compat.h
+++ b/VNFs/DPPD-PROX/prox_compat.h
@@ -17,6 +17,7 @@
#include <rte_table_hash.h>
#include <rte_hash_crc.h>
#include "hash_utils.h"
+#include "quit.h"
/* This is a copy of the rte_table_hash_params from DPDK 17.11 *
* So if DPDK decides to change the structure the modifications *
@@ -128,3 +129,13 @@ static void *prox_rte_table_create(struct prox_rte_table_params *params, int soc
#ifndef DEV_RX_OFFLOAD_JUMBO_FRAME
#define DEV_RX_OFFLOAD_JUMBO_FRAME 0x00000800
#endif
+
+static inline char *prox_strncpy(char * dest, const char * src, size_t count)
+{
+#pragma GCC diagnostic push
+#pragma GCC diagnostic ignored "-Wstringop-truncation"
+ strncpy(dest, src, count);
+#pragma GCC diagnostic pop
+ PROX_PANIC(dest[count - 1] != 0, "\t\tError in strncpy: buffer overrun (%lu bytes)", count);
+ return dest;
+}