numam-dpdk/lib/librte_ipsec
Konstantin Ananyev 423aa5e130 ipsec: fix build with gcc 6
gcc 6.2 and 6.4 fails to compile lib/librte_ipsec/sa.c
with the following errors:
lib/librte_ipsec/sa.c:
 In function inline_outb_tun_pkt_process:
 x86_64-native-linuxapp-gcc/include/rte_memcpy.h:337:2:
 error: array subscript is above array bounds [-Werror=array-bounds]
  rte_mov32((uint8_t *)dst + 1 * 32, (const uint8_t *)src + 1 * 32);
  ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
 ...

It complains about the following lines of code:
esp_outb_tun_pkt_prepare(struct rte_ipsec_sa *sa, rte_be64_t
        ....
        /* update spi, seqn and iv */
        esph = (struct esp_hdr *)(ph + sa->hdr_len);
        iv = (uint64_t *)(esph + 1);
        rte_memcpy(iv, ivp, sa->iv_len);

While I believe it is a false positive,
it is too excessive to use rte_memcpy() here,
as IV length could be only 0/8/16 bytes.
So introduce small helper function to copy IV and use it
instead of rte_memcpy().

Fixes: 4d7ea3e145 ("ipsec: implement SA data-path API")

Signed-off-by: Konstantin Ananyev <konstantin.ananyev@intel.com>
2019-01-15 02:40:40 +01:00
..
crypto.h ipsec: fix build with gcc 6 2019-01-15 02:40:40 +01:00
iph.h ipsec: implement SA data-path API 2019-01-10 16:57:22 +01:00
ipsec_sqn.h ipsec: fix assert condition 2019-01-14 14:45:02 +01:00
Makefile ipsec: add helpers to group completed crypto-ops 2019-01-10 16:57:22 +01:00
meson.build ipsec: add helpers to group completed crypto-ops 2019-01-10 16:57:22 +01:00
pad.h ipsec: implement SA data-path API 2019-01-10 16:57:22 +01:00
rte_ipsec_group.h ipsec: add helpers to group completed crypto-ops 2019-01-10 16:57:22 +01:00
rte_ipsec_sa.h ipsec: rework SA replay window/SQN for MT environment 2019-01-10 16:57:22 +01:00
rte_ipsec_version.map ipsec: add helpers to group completed crypto-ops 2019-01-10 16:57:22 +01:00
rte_ipsec.h ipsec: add helpers to group completed crypto-ops 2019-01-10 16:57:22 +01:00
sa.c ipsec: fix build with gcc 6 2019-01-15 02:40:40 +01:00
sa.h ipsec: rework SA replay window/SQN for MT environment 2019-01-10 16:57:22 +01:00
ses.c ipsec: add SA data-path API 2019-01-10 16:57:22 +01:00