diff options
-rw-r--r-- | net/core/skbuff.c | 10 |
1 files changed, 7 insertions, 3 deletions
diff --git a/net/core/skbuff.c b/net/core/skbuff.c index 09cc38651b2f..52ba2b5e803d 100644 --- a/net/core/skbuff.c +++ b/net/core/skbuff.c | |||
@@ -1699,14 +1699,18 @@ static bool __skb_splice_bits(struct sk_buff *skb, struct pipe_inode_info *pipe, | |||
1699 | struct splice_pipe_desc *spd, struct sock *sk) | 1699 | struct splice_pipe_desc *spd, struct sock *sk) |
1700 | { | 1700 | { |
1701 | int seg; | 1701 | int seg; |
1702 | bool head_is_linear = !skb->head_frag; | ||
1702 | 1703 | ||
1703 | /* | 1704 | /* map the linear part : |
1704 | * map the linear part | 1705 | * If skb->head_frag is set, this 'linear' part is backed |
1706 | * by a fragment, and we can avoid a copy. | ||
1705 | */ | 1707 | */ |
1706 | if (__splice_segment(virt_to_page(skb->data), | 1708 | if (__splice_segment(virt_to_page(skb->data), |
1707 | (unsigned long) skb->data & (PAGE_SIZE - 1), | 1709 | (unsigned long) skb->data & (PAGE_SIZE - 1), |
1708 | skb_headlen(skb), | 1710 | skb_headlen(skb), |
1709 | offset, len, skb, spd, true, sk, pipe)) | 1711 | offset, len, skb, spd, |
1712 | head_is_linear, | ||
1713 | sk, pipe)) | ||
1710 | return true; | 1714 | return true; |
1711 | 1715 | ||
1712 | /* | 1716 | /* |