]> git.ipfire.org Git - thirdparty/kernel/stable.git/commit
skbuff: introduce skb_expand_head()
authorVasily Averin <vvs@virtuozzo.com>
Wed, 25 Dec 2024 05:16:21 +0000 (21:16 -0800)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Thu, 9 Jan 2025 12:24:59 +0000 (13:24 +0100)
commit23f95bbe72506f8ccb95c4f579e6c2570cebfc0f
treedf058a69cdfca37f73b420d7186c06e5d85136c8
parent3754c15b9348b1e81ef9771b335fdec6cd7a93aa
skbuff: introduce skb_expand_head()

[ Upstream commit f1260ff15a71b8fc122b2c9abd8a7abffb6e0168 ]

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>
(cherry picked from commit f1260ff15a71b8fc122b2c9abd8a7abffb6e0168)
Signed-off-by: Harshvardhan Jha <harshvardhan.j.jha@oracle.com>
Signed-off-by: Sasha Levin <sashal@kernel.org>
include/linux/skbuff.h
net/core/skbuff.c