From 41acef9060e0b3ccebc7445fc756d6761c2fd12b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Ilpo=20J=C3=A4rvinen?= Date: Thu, 27 Mar 2008 17:43:41 -0700 Subject: [PATCH] --- yaml --- r: 90416 b: refs/heads/master c: 0dde3e16485dca16eb682dd59da1a598bf62e284 h: refs/heads/master v: v3 --- [refs] | 2 +- trunk/include/linux/skbuff.h | 21 +-------------------- trunk/net/core/skbuff.c | 21 +++++++++++++++++++++ 3 files changed, 23 insertions(+), 21 deletions(-) diff --git a/[refs] b/[refs] index 1f0677bb54c4..3d11f6e42ea7 100644 --- a/[refs] +++ b/[refs] @@ -1,2 +1,2 @@ --- -refs/heads/master: 4f95165d4bf6369d57052d60cc0266c569c6b077 +refs/heads/master: 0dde3e16485dca16eb682dd59da1a598bf62e284 diff --git a/trunk/include/linux/skbuff.h b/trunk/include/linux/skbuff.h index 7beb239d2ee0..f085955cb5a7 100644 --- a/trunk/include/linux/skbuff.h +++ b/trunk/include/linux/skbuff.h @@ -892,6 +892,7 @@ static inline void skb_set_tail_pointer(struct sk_buff *skb, const int offset) /* * Add data to an sk_buff */ +extern unsigned char *skb_put(struct sk_buff *skb, unsigned int len); static inline unsigned char *__skb_put(struct sk_buff *skb, unsigned int len) { unsigned char *tmp = skb_tail_pointer(skb); @@ -901,26 +902,6 @@ static inline unsigned char *__skb_put(struct sk_buff *skb, unsigned int len) return tmp; } -/** - * skb_put - add data to a buffer - * @skb: buffer to use - * @len: amount of data to add - * - * This function extends the used data area of the buffer. If this would - * exceed the total buffer size the kernel will panic. A pointer to the - * first byte of the extra data is returned. - */ -static inline unsigned char *skb_put(struct sk_buff *skb, unsigned int len) -{ - unsigned char *tmp = skb_tail_pointer(skb); - SKB_LINEAR_ASSERT(skb); - skb->tail += len; - skb->len += len; - if (unlikely(skb->tail > skb->end)) - skb_over_panic(skb, len, current_text_addr()); - return tmp; -} - static inline unsigned char *__skb_push(struct sk_buff *skb, unsigned int len) { skb->data -= len; diff --git a/trunk/net/core/skbuff.c b/trunk/net/core/skbuff.c index 0d0fd28a9041..3402eca768f8 100644 --- a/trunk/net/core/skbuff.c +++ b/trunk/net/core/skbuff.c @@ -857,6 +857,27 @@ int skb_pad(struct sk_buff *skb, int pad) return err; } +/** + * skb_put - add data to a buffer + * @skb: buffer to use + * @len: amount of data to add + * + * This function extends the used data area of the buffer. 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 *skb_put(struct sk_buff *skb, unsigned int len) +{ + unsigned char *tmp = skb_tail_pointer(skb); + SKB_LINEAR_ASSERT(skb); + skb->tail += len; + skb->len += len; + if (unlikely(skb->tail > skb->end)) + skb_over_panic(skb, len, __builtin_return_address(0)); + return tmp; +} +EXPORT_SYMBOL(skb_put); + /* Trims skb to length len. It can change skb pointers. */