examples/ipsec-secgw: fix build with gcc 4.5.1
authorRadu Nicolau <radu.nicolau@intel.com>
Thu, 9 Nov 2017 09:57:21 +0000 (09:57 +0000)
committerThomas Monjalon <thomas@monjalon.net>
Fri, 10 Nov 2017 01:48:33 +0000 (02:48 +0100)
On SUSE11 with gcc 4.5.1 the following build error occurred,
most likely because of improper handling of annonymous unions:

examples/ipsec-secgw/ipsec.c:87:4 error:
unknown field ‘ipsec’ specified in initializer

Fixes: ec17993a145a ("examples/ipsec-secgw: support security offload")

Signed-off-by: Radu Nicolau <radu.nicolau@intel.com>
Acked-by: Pablo de Lara <pablo.de.lara.guarch@intel.com>
examples/ipsec-secgw/ipsec.c

index c24284d..70ed227 100644 (file)
@@ -84,7 +84,7 @@ create_session(struct ipsec_ctx *ipsec_ctx, struct ipsec_sa *sa)
                struct rte_security_session_conf sess_conf = {
                        .action_type = sa->type,
                        .protocol = RTE_SECURITY_PROTOCOL_IPSEC,
-                       .ipsec = {
+                       {.ipsec = {
                                .spi = sa->spi,
                                .salt = sa->salt,
                                .options = { 0 },
@@ -94,7 +94,7 @@ create_session(struct ipsec_ctx *ipsec_ctx, struct ipsec_sa *sa)
                                                sa->flags == IP6_TUNNEL) ?
                                        RTE_SECURITY_IPSEC_SA_MODE_TUNNEL :
                                        RTE_SECURITY_IPSEC_SA_MODE_TRANSPORT,
-                       },
+                       } },
                        .crypto_xform = sa->xforms
 
                };