diff options
Diffstat (limited to 'net/core/skbuff.c')
-rw-r--r-- | net/core/skbuff.c | 21 |
1 files changed, 21 insertions, 0 deletions
diff --git a/net/core/skbuff.c b/net/core/skbuff.c index 01abf1e8990b..2960c8b82b23 100644 --- a/net/core/skbuff.c +++ b/net/core/skbuff.c | |||
@@ -1795,6 +1795,27 @@ int skb_append_datato_frags(struct sock *sk, struct sk_buff *skb, | |||
1795 | return 0; | 1795 | return 0; |
1796 | } | 1796 | } |
1797 | 1797 | ||
1798 | /** | ||
1799 | * skb_pull_rcsum - pull skb and update receive checksum | ||
1800 | * @skb: buffer to update | ||
1801 | * @start: start of data before pull | ||
1802 | * @len: length of data pulled | ||
1803 | * | ||
1804 | * This function performs an skb_pull on the packet and updates | ||
1805 | * update the CHECKSUM_HW checksum. It should be used on receive | ||
1806 | * path processing instead of skb_pull unless you know that the | ||
1807 | * checksum difference is zero (e.g., a valid IP header) or you | ||
1808 | * are setting ip_summed to CHECKSUM_NONE. | ||
1809 | */ | ||
1810 | unsigned char *skb_pull_rcsum(struct sk_buff *skb, unsigned int len) | ||
1811 | { | ||
1812 | BUG_ON(len > skb->len); | ||
1813 | skb->len -= len; | ||
1814 | BUG_ON(skb->len < skb->data_len); | ||
1815 | skb_postpull_rcsum(skb, skb->data, len); | ||
1816 | return skb->data += len; | ||
1817 | } | ||
1818 | |||
1798 | void __init skb_init(void) | 1819 | void __init skb_init(void) |
1799 | { | 1820 | { |
1800 | skbuff_head_cache = kmem_cache_create("skbuff_head_cache", | 1821 | skbuff_head_cache = kmem_cache_create("skbuff_head_cache", |