From mboxrd@z Thu Jan 1 00:00:00 1970 From: Akhil Goyal Subject: [PATCH] security: fix enum start value Date: Wed, 13 Dec 2017 12:45:08 +0530 Message-ID: <20171213071508.12009-1-akhil.goyal@nxp.com> Mime-Version: 1.0 Content-Type: text/plain Cc: , , , , , , , Akhil Goyal To: Return-path: Received: from NAM02-SN1-obe.outbound.protection.outlook.com (mail-sn1nam02on0069.outbound.protection.outlook.com [104.47.36.69]) by dpdk.org (Postfix) with ESMTP id F39E91C00 for ; Wed, 13 Dec 2017 08:18:45 +0100 (CET) List-Id: DPDK patches and discussions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: dev-bounces@dpdk.org Sender: "dev" enum should be initialized with 1 so that unitialized(memset) memory may not be treated as a valid enum value. Fixes: c261d1431bd8 ("security: introduce security API and framework") Signed-off-by: Akhil Goyal --- lib/librte_security/rte_security.h | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/lib/librte_security/rte_security.h b/lib/librte_security/rte_security.h index 653929b..39b624b 100644 --- a/lib/librte_security/rte_security.h +++ b/lib/librte_security/rte_security.h @@ -60,7 +60,7 @@ extern "C" { /** IPSec protocol mode */ enum rte_security_ipsec_sa_mode { - RTE_SECURITY_IPSEC_SA_MODE_TRANSPORT, + RTE_SECURITY_IPSEC_SA_MODE_TRANSPORT = 1, /**< IPSec Transport mode */ RTE_SECURITY_IPSEC_SA_MODE_TUNNEL, /**< IPSec Tunnel mode */ @@ -68,7 +68,7 @@ enum rte_security_ipsec_sa_mode { /** IPSec Protocol */ enum rte_security_ipsec_sa_protocol { - RTE_SECURITY_IPSEC_SA_PROTO_AH, + RTE_SECURITY_IPSEC_SA_PROTO_AH = 1, /**< AH protocol */ RTE_SECURITY_IPSEC_SA_PROTO_ESP, /**< ESP protocol */ @@ -76,7 +76,7 @@ enum rte_security_ipsec_sa_protocol { /** IPSEC tunnel type */ enum rte_security_ipsec_tunnel_type { - RTE_SECURITY_IPSEC_TUNNEL_IPV4, + RTE_SECURITY_IPSEC_TUNNEL_IPV4 = 1, /**< Outer header is IPv4 */ RTE_SECURITY_IPSEC_TUNNEL_IPV6, /**< Outer header is IPv6 */ @@ -252,7 +252,7 @@ enum rte_security_session_action_type { /** Security session protocol definition */ enum rte_security_session_protocol { - RTE_SECURITY_PROTOCOL_IPSEC, + RTE_SECURITY_PROTOCOL_IPSEC = 1, /**< IPsec Protocol */ RTE_SECURITY_PROTOCOL_MACSEC, /**< MACSec Protocol */ -- 2.9.3