X-Git-Url: https://gerrit.opnfv.org/gerrit/gitweb?a=blobdiff_plain;f=VNFs%2FDPPD-PROX%2Fprox_compat.h;h=7564f2947612c4305a5148cbd5b312af07aaede8;hb=fb0c44a;hp=3ad041405e6ad0adc54effc552b31a0cd23abe67;hpb=9e5b1c09840e5536ad74b4143e31cbd04d7e966c;p=samplevnf.git 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 #include #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; +}