From mboxrd@z Thu Jan 1 00:00:00 1970 From: Thomas Monjalon Subject: Re: [PATCH] lib/librte_ip_frag:fix ip_frag_key_cmp bug Date: Sun, 05 Aug 2018 14:59:21 +0200 Message-ID: <4156592.vZpZK2Boq5@xps> References: <1533175263-4642-1-git-send-email-han.li1@zte.com.cn> Mime-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7Bit Cc: dev@dpdk.org, Li Han To: konstantin.ananyev@intel.com Return-path: Received: from out1-smtp.messagingengine.com (out1-smtp.messagingengine.com [66.111.4.25]) by dpdk.org (Postfix) with ESMTP id E9CEA1B5E9 for ; Sun, 5 Aug 2018 14:59:33 +0200 (CEST) In-Reply-To: <1533175263-4642-1-git-send-email-han.li1@zte.com.cn> List-Id: DPDK patches and discussions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: dev-bounces@dpdk.org Sender: "dev" Konstantin, Is it candidate for last minute fix in 18.08? 02/08/2018 04:01, Li Han: > in struct ip_frag_key,src_dst[] type is uint64_t. > but "val" which to store the calc restult ,type is uint32_t. > we may lost high 32 bit key. and function return value is int, > but it won't return < 0. > > Signed-off-by: Li Han > --- > lib/librte_ip_frag/ip_frag_common.h | 4 ++-- > 1 file changed, 2 insertions(+), 2 deletions(-) > > diff --git a/lib/librte_ip_frag/ip_frag_common.h b/lib/librte_ip_frag/ip_frag_common.h > index 197acf8..ca69680 100644 > --- a/lib/librte_ip_frag/ip_frag_common.h > +++ b/lib/librte_ip_frag/ip_frag_common.h > @@ -69,10 +69,10 @@ struct ip_frag_pkt * ip_frag_lookup(struct rte_ip_frag_tbl *tbl, > } > > /* compare two keys */ > -static inline int > +static inline uint64_t > ip_frag_key_cmp(const struct ip_frag_key * k1, const struct ip_frag_key * k2) > { > - uint32_t i, val; > + uint64_t i, val; > val = k1->id ^ k2->id; > for (i = 0; i < k1->key_len; i++) > val |= k1->src_dst[i] ^ k2->src_dst[i]; >