aboutsummaryrefslogtreecommitdiffstats
path: root/net/core
diff options
context:
space:
mode:
authorMathias Krause <mathias.krause@secunet.com>2013-11-07 08:18:24 -0500
committerDavid S. Miller <davem@davemloft.net>2013-11-07 19:28:58 -0500
commit0c7ddf36c29c3ce12f2d2931a357ccaa0861035a (patch)
tree98d09efb875438c09ba8eea351e11c15eff7cc59 /net/core
parentb5ad795e52dae6e9f88b193a5e779b70005d005c (diff)
net: move pskb_put() to core code
This function has usage beside IPsec so move it to the core skbuff code. While doing so, give it some documentation and change its return type to 'unsigned char *' to be in line with skb_put(). Signed-off-by: Mathias Krause <mathias.krause@secunet.com> Cc: Steffen Klassert <steffen.klassert@secunet.com> Cc: "David S. Miller" <davem@davemloft.net> Cc: Herbert Xu <herbert@gondor.apana.org.au> Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'net/core')
-rw-r--r--net/core/skbuff.c23
1 files changed, 23 insertions, 0 deletions
diff --git a/net/core/skbuff.c b/net/core/skbuff.c
index 3735fad5616e..2fbea08c4f50 100644
--- a/net/core/skbuff.c
+++ b/net/core/skbuff.c
@@ -1264,6 +1264,29 @@ free_skb:
1264EXPORT_SYMBOL(skb_pad); 1264EXPORT_SYMBOL(skb_pad);
1265 1265
1266/** 1266/**
1267 * pskb_put - add data to the tail of a potentially fragmented buffer
1268 * @skb: start of the buffer to use
1269 * @tail: tail fragment of the buffer to use
1270 * @len: amount of data to add
1271 *
1272 * This function extends the used data area of the potentially
1273 * fragmented buffer. @tail must be the last fragment of @skb -- or
1274 * @skb itself. If this would exceed the total buffer size the kernel
1275 * will panic. A pointer to the first byte of the extra data is
1276 * returned.
1277 */
1278
1279unsigned char *pskb_put(struct sk_buff *skb, struct sk_buff *tail, int len)
1280{
1281 if (tail != skb) {
1282 skb->data_len += len;
1283 skb->len += len;
1284 }
1285 return skb_put(tail, len);
1286}
1287EXPORT_SYMBOL_GPL(pskb_put);
1288
1289/**
1267 * skb_put - add data to a buffer 1290 * skb_put - add data to a buffer
1268 * @skb: buffer to use 1291 * @skb: buffer to use
1269 * @len: amount of data to add 1292 * @len: amount of data to add