提交 ef527f96 编写于 作者: E Eric Dumazet 提交者: Jakub Kicinski

net: __pskb_pull_tail() & pskb_carve_frag_list() drop_monitor friends

Whenever one of these functions pull all data from an skb in a frag_list,
use consume_skb() instead of kfree_skb() to avoid polluting drop
monitoring.

Fixes: 6fa01ccd ("skbuff: Add pskb_extract() helper function")
Signed-off-by: NEric Dumazet <edumazet@google.com>
Link: https://lore.kernel.org/r/20220220154052.1308469-1-eric.dumazet@gmail.comSigned-off-by: NJakub Kicinski <kuba@kernel.org>
上级 5663b854
...@@ -2276,7 +2276,7 @@ void *__pskb_pull_tail(struct sk_buff *skb, int delta) ...@@ -2276,7 +2276,7 @@ void *__pskb_pull_tail(struct sk_buff *skb, int delta)
/* Free pulled out fragments. */ /* Free pulled out fragments. */
while ((list = skb_shinfo(skb)->frag_list) != insp) { while ((list = skb_shinfo(skb)->frag_list) != insp) {
skb_shinfo(skb)->frag_list = list->next; skb_shinfo(skb)->frag_list = list->next;
kfree_skb(list); consume_skb(list);
} }
/* And insert new clone at head. */ /* And insert new clone at head. */
if (clone) { if (clone) {
...@@ -6105,7 +6105,7 @@ static int pskb_carve_frag_list(struct sk_buff *skb, ...@@ -6105,7 +6105,7 @@ static int pskb_carve_frag_list(struct sk_buff *skb,
/* Free pulled out fragments. */ /* Free pulled out fragments. */
while ((list = shinfo->frag_list) != insp) { while ((list = shinfo->frag_list) != insp) {
shinfo->frag_list = list->next; shinfo->frag_list = list->next;
kfree_skb(list); consume_skb(list);
} }
/* And insert new clone at head. */ /* And insert new clone at head. */
if (clone) { if (clone) {
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册