From mboxrd@z Thu Jan 1 00:00:00 1970 From: Thomas Monjalon Subject: Re: [PATCH] ipsec: fix compilation problem Date: Mon, 14 Jan 2019 23:17:52 +0100 Message-ID: <1875496.bnsbQ71OuB@xps> References: <1547481483-25978-1-git-send-email-konstantin.ananyev@intel.com> Mime-Version: 1.0 Content-Type: text/plain; charset="iso-8859-1" Content-Transfer-Encoding: quoted-printable Cc: dev@dpdk.org, akhil.goyal@nxp.com To: Konstantin Ananyev Return-path: Received: from out3-smtp.messagingengine.com (out3-smtp.messagingengine.com [66.111.4.27]) by dpdk.org (Postfix) with ESMTP id C93FE1B10C for ; Mon, 14 Jan 2019 23:17:55 +0100 (CET) In-Reply-To: <1547481483-25978-1-git-send-email-konstantin.ananyev@intel.com> List-Id: DPDK patches and discussions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: dev-bounces@dpdk.org Sender: "dev" 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 =E2inline_outb_tun_pkt_process=E2: > dpdk.org/x86_64-native-linuxapp-gcc/include/rte_memcpy.h:337:2: > error: array subscript is above array bounds [-Werror=3Darray-bounds] > rte_mov32((uint8_t *)dst + 1 * 32, (const uint8_t *)src + 1 * 32); > ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ > ... >=20 > 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 =3D (struct esp_hdr *)(ph + sa->hdr_len); > iv =3D (uint64_t *)(esph + 1); > rte_memcpy(iv, ivp, sa->iv_len); >=20 > 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(). >=20 > Fixes: 4d7ea3e1459b ("ipsec: implement SA data-path API") > Signed-off-by: Konstantin Ananyev Applied, thanks