[dpdk-dev] [PATCH] ipsec: fix compilation problem
Thomas Monjalon
thomas at monjalon.net
Mon Jan 14 23:17:52 CET 2019
14/01/2019 16:58, Konstantin Ananyev:
> gcc 6.2 and 6.4 fails to compile lib/librte_ipsec/sa.c
> with the following errors:
> /local/kananye1/dpdk.org/lib/librte_ipsec/sa.c:
> In function âinline_outb_tun_pkt_processâ:
> dpdk.org/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: 4d7ea3e1459b ("ipsec: implement SA data-path API")
> Signed-off-by: Konstantin Ananyev <konstantin.ananyev at intel.com>
Applied, thanks
More information about the dev
mailing list