net: fix build with gcc 4.4.7 and strict aliasing
authorDaniel Mrzyglod <danielx.t.mrzyglod@intel.com>
Tue, 24 Nov 2015 16:31:18 +0000 (17:31 +0100)
committerThomas Monjalon <thomas.monjalon@6wind.com>
Wed, 25 Nov 2015 21:11:37 +0000 (22:11 +0100)
commite079655c41fb89045ddf5237c5f9a78028b2e39c
treeaf8edc1142dcc272abef7d8390b2ddf181208106
parent66874e55f55080acd28ef8bc215ff453953cac01
net: fix build with gcc 4.4.7 and strict aliasing

This fix is for IPv6 checksum offload error on RHEL65.
Any optimalisation above -O0 provide error in IPv6 checksum
flag "-fstrict-aliasing" is default for optimalisation above -O0.

Step 1: testpmd -c 0x6 -n 4  -- -i --portmask=0x3 --disable-hw-vlan
                --enable-rx-cksum --crc-strip --txqflags=0
Step 2: settings and start
           set verbose 1
           set fwd csum
           start
Step 3: send scapy with bad checksum IPv6/TCP packet
           Ether(src="52:00:00:00:00:00",
  dst="90:e2:ba:4a:33:5d")/IPv6(src="::1")/TCP(chksum=0xf)/("X"*46)
Step 4: Received packets:
           RESULTS: IPv6/TCP': ['0xd41'] or other unexpected.
  EXPECTED RESULTS: IPv6/TCP': ['0x9f5e']

Fixes: 2b039d5f20a3 ("net: fix build with gcc 4.4.7 and strict aliasing")

Signed-off-by: Daniel Mrzyglod <danielx.t.mrzyglod@intel.com>
Acked-by: Konstantin Ananyev <konstantin.ananyev@intel.com>
lib/librte_net/rte_ip.h