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 2ABA3A0548; Tue, 7 Jun 2022 19:18:14 +0200 (CEST) Received: from [217.70.189.124] (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id A00D2427F4; Tue, 7 Jun 2022 19:17:56 +0200 (CEST) Received: from mail-pj1-f46.google.com (mail-pj1-f46.google.com [209.85.216.46]) by mails.dpdk.org (Postfix) with ESMTP id BB818427F0 for ; Tue, 7 Jun 2022 19:17:54 +0200 (CEST) Received: by mail-pj1-f46.google.com with SMTP id q12-20020a17090a304c00b001e2d4fb0eb4so21417043pjl.4 for ; Tue, 07 Jun 2022 10:17:54 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=networkplumber-org.20210112.gappssmtp.com; s=20210112; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=QgGfGr5aPf16UEAKBnZNkuT58w3Bjnm9SUl8gXSpLlw=; b=eGy8FwlarVwprWvxe/DFhtfrt2kEWE9qGYMxpx5eP3Yyv5GqTST3cBHCh1a+OWKYQZ +gmiucYMmTIZKzDtmRhTyeK0gwXq4S0wo5lmA8cNgZHg9/M75tkyek2/d8gsmZ4yWfxV YkD4YJ9MYW9YUW/Jme+x4OQWldHxD/qbRGXj08TdCWUE88rUe3BfprmJkKfBkABJANJj QazcZL2pnDhvRckcxyc96ULk9xFLa+RkMj7EMsXcLhQzh2jPI4U7WYJfWSnejZuB7NfZ ycYXeZ7USNiPw/OfkQNwC6ZN0BcGFKrhd8YqW9fhIGTdPvMpGBAdKNvst6d30KssKqj/ HeaA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=QgGfGr5aPf16UEAKBnZNkuT58w3Bjnm9SUl8gXSpLlw=; b=Hbsc5SfgfPr5Obpl8NEtCPV46XlYGXM7SjHquk0sqy1A/JktoZSgv9kYeqdNooeoaH gXCSN04/Bcp4qYrfIF/qQH77CoqCTFCkn8o4VZtD0S177Wu590wJfWdvrPgeSjKWtk7R gF5HOx9ifBXgwoJIJminN5U+GZoRmeXPhYf+yFGwTmZHYLRnHRlsbZqveGoamE347ujE Es0EeCwRrpTTcF6HekU0xsPi395oUW+tgR79JAAbUhma5UvEyxxmZnfWy5blWTBI39TY hPooLTyFBK/AwHNGWCvedCYS95b7RNLoyi1S/UGMaIF4EDYJ3XogaNTdkBeV72vqymjp iA+Q== X-Gm-Message-State: AOAM533wW5isUtQZKDAjiCpah+/kSvgWNvRpGY9F6RNt3QSlnNuf/bDD 0VJsSnz3qh14iqafx4FS5CsIVVPVeo05iA== X-Google-Smtp-Source: ABdhPJxy6+QiVVWDh3Gv5qRz+CE9wouUcwScKrgJn/PrMmUvoonl0lDtwIujAovWznMhVAj/0Yh2FA== X-Received: by 2002:a17:90b:4a90:b0:1e8:626c:e1b2 with SMTP id lp16-20020a17090b4a9000b001e8626ce1b2mr17654314pjb.141.1654622273730; Tue, 07 Jun 2022 10:17:53 -0700 (PDT) Received: from hermes.local (204-195-112-199.wavecable.com. [204.195.112.199]) by smtp.gmail.com with ESMTPSA id x2-20020a627c02000000b005087c23ad8dsm13185281pfc.0.2022.06.07.10.17.52 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 07 Jun 2022 10:17:53 -0700 (PDT) From: Stephen Hemminger To: dev@dpdk.org Cc: Stephen Hemminger , Konstantin Ananyev Subject: [RFC 4/8] test/ipfrag: fix gcc-12 warnings Date: Tue, 7 Jun 2022 10:17:42 -0700 Message-Id: <20220607171746.461772-5-stephen@networkplumber.org> X-Mailer: git-send-email 2.35.1 In-Reply-To: <20220607171746.461772-1-stephen@networkplumber.org> References: <20220607171746.461772-1-stephen@networkplumber.org> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-BeenThere: dev@dpdk.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: DPDK patches and discussions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: dev-bounces@dpdk.org Using rte_memcpy is not necessary here. It also causes warnings from derefencing past end of input. Signed-off-by: Stephen Hemminger --- app/test/test_ipfrag.c | 13 ++++++------- 1 file changed, 6 insertions(+), 7 deletions(-) diff --git a/app/test/test_ipfrag.c b/app/test/test_ipfrag.c index dc62b0e5475b..ba0ffd080604 100644 --- a/app/test/test_ipfrag.c +++ b/app/test/test_ipfrag.c @@ -23,7 +23,6 @@ test_ipfrag(void) #include #include -#include #include #define NUM_MBUFS 128 @@ -147,13 +146,13 @@ test_get_ipv4_opt(bool is_first_frag, bool opt_copied, if (opt_copied) { expected_opt->len = sizeof(expected_first_frag_ipv4_opts_copied); - rte_memcpy(expected_opt->data, + memcpy(expected_opt->data, expected_first_frag_ipv4_opts_copied, sizeof(expected_first_frag_ipv4_opts_copied)); } else { expected_opt->len = sizeof(expected_first_frag_ipv4_opts_nocopied); - rte_memcpy(expected_opt->data, + memcpy(expected_opt->data, expected_first_frag_ipv4_opts_nocopied, sizeof(expected_first_frag_ipv4_opts_nocopied)); } @@ -161,13 +160,13 @@ test_get_ipv4_opt(bool is_first_frag, bool opt_copied, if (opt_copied) { expected_opt->len = sizeof(expected_sub_frag_ipv4_opts_copied); - rte_memcpy(expected_opt->data, + memcpy(expected_opt->data, expected_sub_frag_ipv4_opts_copied, sizeof(expected_sub_frag_ipv4_opts_copied)); } else { expected_opt->len = sizeof(expected_sub_frag_ipv4_opts_nocopied); - rte_memcpy(expected_opt->data, + memcpy(expected_opt->data, expected_sub_frag_ipv4_opts_nocopied, sizeof(expected_sub_frag_ipv4_opts_nocopied)); } @@ -227,7 +226,7 @@ v4_allocate_packet_of(struct rte_mbuf *b, int fill, size_t s, hdr->src_addr = rte_cpu_to_be_32(0x8080808); hdr->dst_addr = rte_cpu_to_be_32(0x8080404); - rte_memcpy(hdr + 1, opt.data, opt.len); + memcpy(hdr + 1, opt.data, opt.len); } static void @@ -312,7 +311,7 @@ test_get_frag_opt(struct rte_mbuf **mb, int32_t num, char *iph_opt = rte_pktmbuf_mtod_offset(mb[i], char *, sizeof(struct rte_ipv4_hdr)); opt->len = opt_len; - rte_memcpy(opt->data, iph_opt, opt_len); + memcpy(opt->data, iph_opt, opt_len); } else { opt->len = RTE_IPV4_HDR_OPT_MAX_LEN; memset(opt->data, RTE_IPV4_HDR_OPT_EOL, -- 2.35.1