---
name: "skb_clone_sk"
section: "9"
platform: "linux"
package: "linux-manual-4.9"
version: "4.9.228-1"
release: "Debian 9 (Stretch)"
platforms: ["linux"]
url: "https://new.carta.tech/skb_clone_sk"
---

# skb\_clone\_sk(9)

create clone of skb, and take reference to socket

## NAME

skb\_clone\_sk - create clone of skb, and take reference to socket

## SYNOPSIS

**struct sk\_buff \* skb\_clone\_sk(struct sk\_buff \*** *skb***);**

## ARGUMENTS

*skb*

the skb to clone

## DESCRIPTION

This function creates a clone of a buffer that holds a reference on sk\_refcnt. Buffers created via this function are meant to be returned using sock\_queue\_err\_skb, or free via kfree\_skb.

When passing buffers allocated with this function to sock\_queue\_err\_skb it is necessary to wrap the call with sock\_hold/sock\_put in order to prevent the socket from being released prior to being enqueued on the sk\_error\_queue.

## COPYRIGHT
