]> git.kernelconcepts.de Git - karo-tx-linux.git/commitdiff
skb: Add documentation for skb_clone_sk
authorAlexander Duyck <alexander.h.duyck@intel.com>
Wed, 10 Sep 2014 22:05:26 +0000 (18:05 -0400)
committerDavid S. Miller <davem@davemloft.net>
Fri, 12 Sep 2014 21:51:24 +0000 (17:51 -0400)
This change adds some documentation to the call skb_clone_sk.  This is
meant to help clarify the purpose of the function for other developers.

Signed-off-by: Alexander Duyck <alexander.h.duyck@intel.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
net/core/skbuff.c

index a18dfb02d94492647a50a88797e47d0f698ad62b..c9da77a95e2d20c1d311244bf4c840bd96120980 100644 (file)
@@ -3511,6 +3511,19 @@ struct sk_buff *sock_dequeue_err_skb(struct sock *sk)
 }
 EXPORT_SYMBOL(sock_dequeue_err_skb);
 
+/**
+ * skb_clone_sk - create clone of skb, and take reference to socket
+ * @skb: the skb to clone
+ *
+ * This function creates a clone of a buffer that holds a reference on
+ * sk_refcnt.  Buffers created via this function are meant to be
+ * returned using sock_queue_err_skb, or free via kfree_skb.
+ *
+ * When passing buffers allocated with this function to sock_queue_err_skb
+ * it is necessary to wrap the call with sock_hold/sock_put in order to
+ * prevent the socket from being released prior to being enqueued on
+ * the sk_error_queue.
+ */
 struct sk_buff *skb_clone_sk(struct sk_buff *skb)
 {
        struct sock *sk = skb->sk;