From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mails.dpdk.org (mails.dpdk.org [217.70.189.124]) by inbox.dpdk.org (Postfix) with ESMTP id 3AAD845D78 for ; Fri, 22 Nov 2024 01:34:42 +0100 (CET) Received: from mails.dpdk.org (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id 0F6214026A; Fri, 22 Nov 2024 01:34:42 +0100 (CET) Received: from szxga01-in.huawei.com (szxga01-in.huawei.com [45.249.212.187]) by mails.dpdk.org (Postfix) with ESMTP id CEA734026A; Fri, 22 Nov 2024 01:34:39 +0100 (CET) Received: from mail.maildlp.com (unknown [172.19.163.252]) by szxga01-in.huawei.com (SkyGuard) with ESMTP id 4XvbfB2yfHz10WCQ; Fri, 22 Nov 2024 08:32:34 +0800 (CST) Received: from kwepemk500009.china.huawei.com (unknown [7.202.194.94]) by mail.maildlp.com (Postfix) with ESMTPS id 01631180214; Fri, 22 Nov 2024 08:34:38 +0800 (CST) Received: from [10.67.121.161] (10.67.121.161) by kwepemk500009.china.huawei.com (7.202.194.94) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.2.1544.11; Fri, 22 Nov 2024 08:34:37 +0800 Message-ID: Date: Fri, 22 Nov 2024 08:34:36 +0800 MIME-Version: 1.0 User-Agent: Mozilla Thunderbird Subject: Re: [PATCH v4 3/9] app/test: fix paren typo To: Stephen Hemminger , CC: , , Bruce Richardson , Akhil Goyal , Anoob Joseph References: <20241114001403.147609-1-stephen@networkplumber.org> <20241121182443.68025-1-stephen@networkplumber.org> <20241121182443.68025-4-stephen@networkplumber.org> Content-Language: en-US From: fengchengwen In-Reply-To: <20241121182443.68025-4-stephen@networkplumber.org> Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: 7bit X-Originating-IP: [10.67.121.161] X-ClientProxiedBy: dggems705-chm.china.huawei.com (10.3.19.182) To kwepemk500009.china.huawei.com (7.202.194.94) X-BeenThere: stable@dpdk.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: patches for DPDK stable branches List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: stable-bounces@dpdk.org Acked-by: Chengwen Feng On 2024/11/22 2:23, Stephen Hemminger wrote: > The parenthesis were in the wrong place so that comparison > took precedence over assignment in handling IPv6 extension > headers. Break up the loop condition to avoid the problem. > > Link: https://pvs-studio.com/en/blog/posts/cpp/1179/ > > Fixes: 15ccc647526e ("test/security: test inline reassembly with multi-segment") > Cc: ndabilpuram@marvell.com > Cc: stable@dpdk.org > > Signed-off-by: Stephen Hemminger > Acked-by: Bruce Richardson > --- > app/test/test_security_inline_proto_vectors.h | 8 +++++--- > 1 file changed, 5 insertions(+), 3 deletions(-) > > diff --git a/app/test/test_security_inline_proto_vectors.h b/app/test/test_security_inline_proto_vectors.h > index b3d724bac6..86dfa54777 100644 > --- a/app/test/test_security_inline_proto_vectors.h > +++ b/app/test/test_security_inline_proto_vectors.h > @@ -519,10 +519,12 @@ test_vector_payload_populate(struct ip_reassembly_test_packet *pkt, > if (extra_data_sum) { > proto = hdr->proto; > p += sizeof(struct rte_ipv6_hdr); > - while (proto != IPPROTO_FRAGMENT && > - (proto = rte_ipv6_get_next_ext(p, proto, &ext_len) >= 0)) > + while (proto != IPPROTO_FRAGMENT) { > + proto = rte_ipv6_get_next_ext(p, proto, &ext_len); > + if (proto < 0) > + break; > p += ext_len; > - > + } > /* Found fragment header, update the frag offset */ > if (proto == IPPROTO_FRAGMENT) { > frag_ext = (struct rte_ipv6_fragment_ext *)p;