---
name: "skb_copy"
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_copy"
---

# skb\_copy(9)

create private copy of an sk\_buff

## NAME

skb\_copy - create private copy of an sk\_buff

## SYNOPSIS

**struct sk\_buff \* skb\_copy(const struct sk\_buff \*** *skb***, gfp\_t** *gfp\_mask***);**

## ARGUMENTS

*skb*

buffer to copy

*gfp\_mask*

allocation priority

## DESCRIPTION

Make a copy of both an sk\_buff and its data. This is used when the caller wishes to modify the data and needs a private copy of the data to alter. Returns **NULL** on failure or the pointer to the buffer on success. The returned buffer has a reference count of 1.

As by-product this function converts non-linear sk\_buff to linear one, so that sk\_buff becomes completely private and caller is allowed to modify all the data of returned buffer. This means that this function is not recommended for use in circumstances when only header is going to be modified. Use **pskb\_copy** instead.

## COPYRIGHT
