tls: rx: device: add input CoW helper
Wrap the remaining skb_cow_data() into a helper, so it's easier
to replace down the lane. The new version will change the skb
so make sure relevant pointers get reloaded after the call.
Signed-off-by: Jakub Kicinski <kuba@kernel.org>
diff --git a/net/tls/tls_strp.c b/net/tls/tls_strp.c
index 40b1773..d9bb4f23 100644
--- a/net/tls/tls_strp.c
+++ b/net/tls/tls_strp.c
@@ -13,6 +13,17 @@ struct sk_buff *tls_strp_msg_detach(struct tls_sw_context_rx *ctx)
return skb;
}
+int tls_strp_msg_cow(struct tls_sw_context_rx *ctx)
+{
+ struct sk_buff *unused;
+ int nsg;
+
+ nsg = skb_cow_data(ctx->recv_pkt, 0, &unused);
+ if (nsg < 0)
+ return nsg;
+ return 0;
+}
+
int tls_strp_msg_hold(struct sock *sk, struct sk_buff *skb,
struct sk_buff_head *dst)
{