Merge branch 'v4l_for_linus' of git://git.kernel.org/pub/scm/linux/kernel/git/mchehab...
[cascardo/linux.git] / net / core / skbuff.c
index e411559..8cec1e6 100644 (file)
@@ -476,6 +476,18 @@ void skb_add_rx_frag(struct sk_buff *skb, int i, struct page *page, int off,
 }
 EXPORT_SYMBOL(skb_add_rx_frag);
 
+void skb_coalesce_rx_frag(struct sk_buff *skb, int i, int size,
+                         unsigned int truesize)
+{
+       skb_frag_t *frag = &skb_shinfo(skb)->frags[i];
+
+       skb_frag_size_add(frag, size);
+       skb->len += size;
+       skb->data_len += size;
+       skb->truesize += truesize;
+}
+EXPORT_SYMBOL(skb_coalesce_rx_frag);
+
 static void skb_drop_list(struct sk_buff **listp)
 {
        kfree_skb_list(*listp);
@@ -580,9 +592,6 @@ static void skb_release_head_state(struct sk_buff *skb)
 #if IS_ENABLED(CONFIG_NF_CONNTRACK)
        nf_conntrack_put(skb->nfct);
 #endif
-#ifdef NET_SKBUFF_NF_DEFRAG_NEEDED
-       nf_conntrack_put_reasm(skb->nfct_reasm);
-#endif
 #ifdef CONFIG_BRIDGE_NETFILTER
        nf_bridge_put(skb->nf_bridge);
 #endif
@@ -1039,8 +1048,8 @@ EXPORT_SYMBOL(__pskb_copy);
  *     @ntail: room to add at tail
  *     @gfp_mask: allocation priority
  *
- *     Expands (or creates identical copy, if &nhead and &ntail are zero)
- *     header of skb. &sk_buff itself is not changed. &sk_buff MUST have
+ *     Expands (or creates identical copy, if @nhead and @ntail are zero)
+ *     header of @skb. &sk_buff itself is not changed. &sk_buff MUST have
  *     reference count of 1. Returns zero in the case of success or error,
  *     if expansion failed. In the last case, &sk_buff is not changed.
  *
@@ -1251,6 +1260,29 @@ free_skb:
 }
 EXPORT_SYMBOL(skb_pad);
 
+/**
+ *     pskb_put - add data to the tail of a potentially fragmented buffer
+ *     @skb: start of the buffer to use
+ *     @tail: tail fragment of the buffer to use
+ *     @len: amount of data to add
+ *
+ *     This function extends the used data area of the potentially
+ *     fragmented buffer. @tail must be the last fragment of @skb -- or
+ *     @skb itself. If this would exceed the total buffer size the kernel
+ *     will panic. A pointer to the first byte of the extra data is
+ *     returned.
+ */
+
+unsigned char *pskb_put(struct sk_buff *skb, struct sk_buff *tail, int len)
+{
+       if (tail != skb) {
+               skb->data_len += len;
+               skb->len += len;
+       }
+       return skb_put(tail, len);
+}
+EXPORT_SYMBOL_GPL(pskb_put);
+
 /**
  *     skb_put - add data to a buffer
  *     @skb: buffer to use
@@ -2528,14 +2560,14 @@ EXPORT_SYMBOL(skb_prepare_seq_read);
  * @data: destination pointer for data to be returned
  * @st: state variable
  *
- * Reads a block of skb data at &consumed relative to the
+ * Reads a block of skb data at @consumed relative to the
  * lower offset specified to skb_prepare_seq_read(). Assigns
- * the head of the data block to &data and returns the length
+ * the head of the data block to @data and returns the length
  * of the block or 0 if the end of the skb data or the upper
  * offset has been reached.
  *
  * The caller is not required to consume all of the data
- * returned, i.e. &consumed is typically set to the number
+ * returned, i.e. @consumed is typically set to the number
  * of bytes already consumed and the next call to
  * skb_seq_read() will return the remaining part of the block.
  *