net: fix how L4 checksum choice is tested
authorIvan Malov <ivan.malov@oktetlabs.ru>
Fri, 28 Jun 2019 03:13:09 +0000 (06:13 +0300)
committerFerruh Yigit <ferruh.yigit@intel.com>
Fri, 28 Jun 2019 18:32:18 +0000 (20:32 +0200)
commit39a94299195f3329a28a3556e2431b9d6b83b222
treec849b18bc60e00a12d5001c1eb340518f9a439f5
parent4dad9c7895d51b7baa3214a52383a24390b0ace6
net: fix how L4 checksum choice is tested

The API to prepare checksum offloads mistreats L4
checksum type enum values as self-contained flags.

Turning these flag checks into enum checks causes
warnings by GCC about possibly uninitialised IPv4
header pointer. The issue was found to show up in
the case of GCC versions 4.8.5 and 5.4.0, however,
it might be the case for a wider variety of other
versions. Initialise the pointer upon declaration.
and explain the reason behind this in the comment.

Fixes: 4fb7e803eb1a ("ethdev: add Tx preparation")
Cc: stable@dpdk.org
Signed-off-by: Ivan Malov <ivan.malov@oktetlabs.ru>
Reviewed-by: Andrew Rybchenko <arybchenko@solarflare.com>
Acked-by: Stephen Hemminger <stephen@networkplumber.org>
Acked-by: Konstantin Ananyev <konstantin.ananyev@intel.com>
lib/librte_net/rte_net.h