[v4,06/30] ip_frag: replace use of fixed size rte_memcpy

Message ID 20240405165518.367503-7-stephen@networkplumber.org (mailing list archive)
State Superseded
Delegated to: Thomas Monjalon
Headers
Series replace use of rte_memcpy with fixed sizes |

Checks

Context Check Description
ci/checkpatch success coding style OK

Commit Message

Stephen Hemminger April 5, 2024, 4:53 p.m. UTC
  Automatically generated by devtools/cocci/rte_memcpy.cocci

Signed-off-by: Stephen Hemminger <stephen@networkplumber.org>
---
 lib/ip_frag/rte_ipv6_fragmentation.c | 4 +---
 lib/ip_frag/rte_ipv6_reassembly.c    | 6 ++----
 2 files changed, 3 insertions(+), 7 deletions(-)
  

Patch

diff --git a/lib/ip_frag/rte_ipv6_fragmentation.c b/lib/ip_frag/rte_ipv6_fragmentation.c
index 56696f32f8..72ce6501c8 100644
--- a/lib/ip_frag/rte_ipv6_fragmentation.c
+++ b/lib/ip_frag/rte_ipv6_fragmentation.c
@@ -5,8 +5,6 @@ 
 #include <stddef.h>
 #include <errno.h>
 
-#include <rte_memcpy.h>
-
 #include "ip_frag_common.h"
 
 /**
@@ -23,7 +21,7 @@  __fill_ipv6hdr_frag(struct rte_ipv6_hdr *dst,
 {
 	struct rte_ipv6_fragment_ext *fh;
 
-	rte_memcpy(dst, src, sizeof(*dst));
+	memcpy(dst, src, sizeof(*dst));
 	dst->payload_len = rte_cpu_to_be_16(len);
 	dst->proto = IPPROTO_FRAGMENT;
 
diff --git a/lib/ip_frag/rte_ipv6_reassembly.c b/lib/ip_frag/rte_ipv6_reassembly.c
index 88863a98d1..663b1737a6 100644
--- a/lib/ip_frag/rte_ipv6_reassembly.c
+++ b/lib/ip_frag/rte_ipv6_reassembly.c
@@ -4,8 +4,6 @@ 
 
 #include <stddef.h>
 
-#include <rte_memcpy.h>
-
 #include "ip_frag_common.h"
 
 /**
@@ -143,8 +141,8 @@  rte_ipv6_frag_reassemble_packet(struct rte_ip_frag_tbl *tbl,
 	int32_t ip_len;
 	int32_t trim;
 
-	rte_memcpy(&key.src_dst[0], ip_hdr->src_addr, 16);
-	rte_memcpy(&key.src_dst[2], ip_hdr->dst_addr, 16);
+	memcpy(&key.src_dst[0], ip_hdr->src_addr, 16);
+	memcpy(&key.src_dst[2], ip_hdr->dst_addr, 16);
 
 	key.id = frag_hdr->id;
 	key.key_len = IPV6_KEYLEN;