net/pkt: Rename net_pkt_clone_new to net_pkt_clone
Now that legacy net_pkt_clone function has been removed, the new
function can be renamed accordingly.
Signed-off-by: Tomasz Bursztyka <tomasz.bursztyka@linux.intel.com>
diff --git a/include/net/net_pkt.h b/include/net/net_pkt.h
index 58c5252..0e11b0f 100644
--- a/include/net/net_pkt.h
+++ b/include/net/net_pkt.h
@@ -2312,14 +2312,14 @@
size_t length);
/**
- * @brief Clone pkt and its fragment chain.
+ * @brief Clone pkt and its buffer.
*
* @param pkt Original pkt to be cloned
* @param timeout Timeout to wait for free buffer
*
* @return NULL if error, cloned packet otherwise.
*/
-struct net_pkt *net_pkt_clone_new(struct net_pkt *pkt, s32_t timeout);
+struct net_pkt *net_pkt_clone(struct net_pkt *pkt, s32_t timeout);
/**
* @brief Read some data from a net_pkt
diff --git a/subsys/net/ip/icmpv4.c b/subsys/net/ip/icmpv4.c
index c80760b..b173285 100644
--- a/subsys/net/ip/icmpv4.c
+++ b/subsys/net/ip/icmpv4.c
@@ -121,7 +121,7 @@
net_pkt_cursor_init(pkt);
/* Cloning is faster here as echo request might come with data behind */
- reply = net_pkt_clone_new(pkt, PKT_WAIT_TIME);
+ reply = net_pkt_clone(pkt, PKT_WAIT_TIME);
if (!reply) {
NET_DBG("DROP: No buffer");
goto drop;
diff --git a/subsys/net/ip/net_if.c b/subsys/net/ip/net_if.c
index b0175f0..73482de 100644
--- a/subsys/net/ip/net_if.c
+++ b/subsys/net/ip/net_if.c
@@ -2754,7 +2754,7 @@
verdict = net_if_l2(iface)->recv(iface, pkt);
if (verdict == NET_CONTINUE) {
- new_pkt = net_pkt_clone_new(pkt, K_NO_WAIT);
+ new_pkt = net_pkt_clone(pkt, K_NO_WAIT);
} else {
new_pkt = net_pkt_ref(pkt);
}
diff --git a/subsys/net/ip/net_pkt.c b/subsys/net/ip/net_pkt.c
index cc349fd..ffded99 100644
--- a/subsys/net/ip/net_pkt.c
+++ b/subsys/net/ip/net_pkt.c
@@ -2716,7 +2716,7 @@
return 0;
}
-struct net_pkt *net_pkt_clone_new(struct net_pkt *pkt, s32_t timeout)
+struct net_pkt *net_pkt_clone(struct net_pkt *pkt, s32_t timeout)
{
struct net_pkt *clone_pkt;
diff --git a/subsys/net/ip/tcp.c b/subsys/net/ip/tcp.c
index f8eaf9c..ff392e1 100644
--- a/subsys/net/ip/tcp.c
+++ b/subsys/net/ip/tcp.c
@@ -949,7 +949,7 @@
}
if (pkt_in_slist) {
- new_pkt = net_pkt_clone_new(pkt, ALLOC_TIMEOUT);
+ new_pkt = net_pkt_clone(pkt, ALLOC_TIMEOUT);
if (!new_pkt) {
return -ENOMEM;
}
diff --git a/tests/net/net_pkt_new/src/main.c b/tests/net/net_pkt_new/src/main.c
index 95dceb6..da7bb74 100644
--- a/tests/net/net_pkt_new/src/main.c
+++ b/tests/net/net_pkt_new/src/main.c
@@ -574,7 +574,7 @@
/* Now let's clone the pkt
* This will test net_pkt_copy_new() as it usses it for the buffers
*/
- pkt_dst = net_pkt_clone_new(pkt_src, K_NO_WAIT);
+ pkt_dst = net_pkt_clone(pkt_src, K_NO_WAIT);
zassert_true(pkt_dst != NULL, "Pkt not clone");
/* Cloning does not take into account left space,