OSDN Git Service

skbuff: introduce skb_expand_head()
authorVasily Averin <vvs@virtuozzo.com>
Mon, 2 Aug 2021 08:52:15 +0000 (11:52 +0300)
committerDavid S. Miller <davem@davemloft.net>
Tue, 3 Aug 2021 10:21:39 +0000 (11:21 +0100)
commitf1260ff15a71b8fc122b2c9abd8a7abffb6e0168
tree5296e2d92972ed29361756ad41d5c44d4b50f247
parentfa976624ae7b6226d080ad21adb306ccb640a5ed
skbuff: introduce skb_expand_head()

Like skb_realloc_headroom(), new helper increases headroom of specified skb.
Unlike skb_realloc_headroom(), it does not allocate a new skb if possible;
copies skb->sk on new skb when as needed and frees original skb in case
of failures.

This helps to simplify ip[6]_finish_output2() and a few other similar cases.

Signed-off-by: Vasily Averin <vvs@virtuozzo.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
include/linux/skbuff.h
net/core/skbuff.c