lpm: fix build of anonymous union initialization
authorMichael Qiu <michael.qiu@intel.com>
Wed, 30 Mar 2016 03:38:12 +0000 (11:38 +0800)
committerThomas Monjalon <thomas.monjalon@6wind.com>
Thu, 31 Mar 2016 19:31:55 +0000 (21:31 +0200)
commite13676bfe7d1df44def6ff27886cc27823323f40
treeea57ce249f19c77ebd204d6d3853f3c8a63d8785
parent8ee787ce80a8a166fb36ba55370db642783539f9
lpm: fix build of anonymous union initialization

In SUSE11-SP3 i686 platform, with gcc 4.5.1, there is a
compile issue:
rte_lpm.c: In function ‘add_depth_small_v20’:
rte_lpm.c:778:7: error: unknown field ‘next_hop’
specified in initializer

The root cause is gcc only allow anonymous union initialized
according to the field it is defined. But next_hop is defined
in different field when in different platform(Endian).

One solution is add if define in the code to avoid this issue,
but there is a simple way, initialize it separately later.

Fixes: afc5c914a083 ("lpm: fix big endian support")

Signed-off-by: Michael Qiu <michael.qiu@intel.com>
lib/librte_lpm/rte_lpm.c