net: add pskb_may_pull_reason() helper
authorEric Dumazet <edumazet@google.com>
Fri, 10 Feb 2023 18:47:06 +0000 (18:47 +0000)
committerJakub Kicinski <kuba@kernel.org>
Tue, 14 Feb 2023 03:55:32 +0000 (19:55 -0800)
commit1fb2d41501f38192d8a19da585cd441cf8845697
tree81c97b4bcf20c5689ebfc82c53d382bcdf8f3b25
parentdc68eaf2c29f410fb078fd6da8e56201d3282e0b
net: add pskb_may_pull_reason() helper

pskb_may_pull() can fail for two different reasons.

Provide pskb_may_pull_reason() helper to distinguish
between these reasons.

It returns:

SKB_NOT_DROPPED_YET           : Success
SKB_DROP_REASON_PKT_TOO_SMALL : packet too small
SKB_DROP_REASON_NOMEM         : skb->head could not be resized

Signed-off-by: Eric Dumazet <edumazet@google.com>
Reviewed-by: David Ahern <dsahern@kernel.org>
Signed-off-by: Jakub Kicinski <kuba@kernel.org>
include/linux/skbuff.h