From: Ferruh Yigit <ferruh.yigit@intel.com>
To: Li Han <han.li1@zte.com.cn>, konstantin.ananyev@intel.com
Cc: dev@dpdk.org
Subject: Re: [PATCH] lib/librte_ip_frag:fix ip_frag_key_cmp bug
Date: Thu, 9 Aug 2018 13:40:27 +0100 [thread overview]
Message-ID: <314a4cdf-68cc-9300-5e9f-e64423caca4d@intel.com> (raw)
In-Reply-To: <1533175263-4642-1-git-send-email-han.li1@zte.com.cn>
On 8/2/2018 3:01 AM, Li Han wrote:
> 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 <han.li1@zte.com.cn>
Fix looks good to me [1], but not sure if it worth getting risk to merge it
after rc3, taking into account that original code is from 2014.
[1] perhaps no need to make "i" uint64_t
> ---
> 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];
>
next prev parent reply other threads:[~2018-08-09 12:40 UTC|newest]
Thread overview: 5+ messages / expand[flat|nested] mbox.gz Atom feed top
2018-08-02 2:01 [PATCH] lib/librte_ip_frag:fix ip_frag_key_cmp bug Li Han
2018-08-05 12:59 ` Thomas Monjalon
2018-08-09 12:40 ` Ferruh Yigit [this message]
2018-08-24 11:04 ` Ananyev, Konstantin
2018-10-28 10:18 ` Thomas Monjalon
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=314a4cdf-68cc-9300-5e9f-e64423caca4d@intel.com \
--to=ferruh.yigit@intel.com \
--cc=dev@dpdk.org \
--cc=han.li1@zte.com.cn \
--cc=konstantin.ananyev@intel.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.