diff options
author | Alexander Duyck <alexander.h.duyck@intel.com> | 2014-09-10 18:05:26 -0400 |
---|---|---|
committer | David S. Miller <davem@davemloft.net> | 2014-09-12 17:51:24 -0400 |
commit | cab41c47d92851de71c74b1a7bdbf0fadf6ae4ba (patch) | |
tree | 2e39ad3236decf2e77e93190eb108c99f15cee6e /net/core | |
parent | 72b126a45eaca22fb6a8788e8a89c159f3ae2ac5 (diff) |
skb: Add documentation for skb_clone_sk
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>
Diffstat (limited to 'net/core')
-rw-r--r-- | net/core/skbuff.c | 13 |
1 files changed, 13 insertions, 0 deletions
diff --git a/net/core/skbuff.c b/net/core/skbuff.c index a18dfb02d944..c9da77a95e2d 100644 --- a/net/core/skbuff.c +++ b/net/core/skbuff.c | |||
@@ -3511,6 +3511,19 @@ struct sk_buff *sock_dequeue_err_skb(struct sock *sk) | |||
3511 | } | 3511 | } |
3512 | EXPORT_SYMBOL(sock_dequeue_err_skb); | 3512 | EXPORT_SYMBOL(sock_dequeue_err_skb); |
3513 | 3513 | ||
3514 | /** | ||
3515 | * skb_clone_sk - create clone of skb, and take reference to socket | ||
3516 | * @skb: the skb to clone | ||
3517 | * | ||
3518 | * This function creates a clone of a buffer that holds a reference on | ||
3519 | * sk_refcnt. Buffers created via this function are meant to be | ||
3520 | * returned using sock_queue_err_skb, or free via kfree_skb. | ||
3521 | * | ||
3522 | * When passing buffers allocated with this function to sock_queue_err_skb | ||
3523 | * it is necessary to wrap the call with sock_hold/sock_put in order to | ||
3524 | * prevent the socket from being released prior to being enqueued on | ||
3525 | * the sk_error_queue. | ||
3526 | */ | ||
3514 | struct sk_buff *skb_clone_sk(struct sk_buff *skb) | 3527 | struct sk_buff *skb_clone_sk(struct sk_buff *skb) |
3515 | { | 3528 | { |
3516 | struct sock *sk = skb->sk; | 3529 | struct sock *sk = skb->sk; |