aboutsummaryrefslogtreecommitdiffstats
path: root/include/linux/skbuff.h
diff options
context:
space:
mode:
Diffstat (limited to 'include/linux/skbuff.h')
-rw-r--r--include/linux/skbuff.h48
1 files changed, 27 insertions, 21 deletions
diff --git a/include/linux/skbuff.h b/include/linux/skbuff.h
index 416a2e4024b2..5d4a990d5577 100644
--- a/include/linux/skbuff.h
+++ b/include/linux/skbuff.h
@@ -183,7 +183,6 @@ struct skb_shared_info {
183 * @priority: Packet queueing priority 183 * @priority: Packet queueing priority
184 * @users: User count - see {datagram,tcp}.c 184 * @users: User count - see {datagram,tcp}.c
185 * @protocol: Packet protocol from driver 185 * @protocol: Packet protocol from driver
186 * @security: Security level of packet
187 * @truesize: Buffer size 186 * @truesize: Buffer size
188 * @head: Head of buffer 187 * @head: Head of buffer
189 * @data: Data head pointer 188 * @data: Data head pointer
@@ -249,18 +248,18 @@ struct sk_buff {
249 data_len, 248 data_len,
250 mac_len, 249 mac_len,
251 csum; 250 csum;
252 unsigned char local_df,
253 cloned:1,
254 nohdr:1,
255 pkt_type,
256 ip_summed;
257 __u32 priority; 251 __u32 priority;
258 unsigned short protocol, 252 __u8 local_df:1,
259 security; 253 cloned:1,
254 ip_summed:2,
255 nohdr:1;
256 /* 3 bits spare */
257 __u8 pkt_type;
258 __u16 protocol;
260 259
261 void (*destructor)(struct sk_buff *skb); 260 void (*destructor)(struct sk_buff *skb);
262#ifdef CONFIG_NETFILTER 261#ifdef CONFIG_NETFILTER
263 unsigned long nfmark; 262 unsigned long nfmark;
264 __u32 nfcache; 263 __u32 nfcache;
265 __u32 nfctinfo; 264 __u32 nfctinfo;
266 struct nf_conntrack *nfct; 265 struct nf_conntrack *nfct;
@@ -301,20 +300,26 @@ struct sk_buff {
301#include <asm/system.h> 300#include <asm/system.h>
302 301
303extern void __kfree_skb(struct sk_buff *skb); 302extern void __kfree_skb(struct sk_buff *skb);
304extern struct sk_buff *alloc_skb(unsigned int size, int priority); 303extern struct sk_buff *alloc_skb(unsigned int size,
304 unsigned int __nocast priority);
305extern struct sk_buff *alloc_skb_from_cache(kmem_cache_t *cp, 305extern struct sk_buff *alloc_skb_from_cache(kmem_cache_t *cp,
306 unsigned int size, int priority); 306 unsigned int size,
307 unsigned int __nocast priority);
307extern void kfree_skbmem(struct sk_buff *skb); 308extern void kfree_skbmem(struct sk_buff *skb);
308extern struct sk_buff *skb_clone(struct sk_buff *skb, int priority); 309extern struct sk_buff *skb_clone(struct sk_buff *skb,
309extern struct sk_buff *skb_copy(const struct sk_buff *skb, int priority); 310 unsigned int __nocast priority);
310extern struct sk_buff *pskb_copy(struct sk_buff *skb, int gfp_mask); 311extern struct sk_buff *skb_copy(const struct sk_buff *skb,
312 unsigned int __nocast priority);
313extern struct sk_buff *pskb_copy(struct sk_buff *skb,
314 unsigned int __nocast gfp_mask);
311extern int pskb_expand_head(struct sk_buff *skb, 315extern int pskb_expand_head(struct sk_buff *skb,
312 int nhead, int ntail, int gfp_mask); 316 int nhead, int ntail,
317 unsigned int __nocast gfp_mask);
313extern struct sk_buff *skb_realloc_headroom(struct sk_buff *skb, 318extern struct sk_buff *skb_realloc_headroom(struct sk_buff *skb,
314 unsigned int headroom); 319 unsigned int headroom);
315extern struct sk_buff *skb_copy_expand(const struct sk_buff *skb, 320extern struct sk_buff *skb_copy_expand(const struct sk_buff *skb,
316 int newheadroom, int newtailroom, 321 int newheadroom, int newtailroom,
317 int priority); 322 unsigned int __nocast priority);
318extern struct sk_buff * skb_pad(struct sk_buff *skb, int pad); 323extern struct sk_buff * skb_pad(struct sk_buff *skb, int pad);
319#define dev_kfree_skb(a) kfree_skb(a) 324#define dev_kfree_skb(a) kfree_skb(a)
320extern void skb_over_panic(struct sk_buff *skb, int len, 325extern void skb_over_panic(struct sk_buff *skb, int len,
@@ -465,7 +470,8 @@ static inline int skb_shared(const struct sk_buff *skb)
465 * 470 *
466 * NULL is returned on a memory allocation failure. 471 * NULL is returned on a memory allocation failure.
467 */ 472 */
468static inline struct sk_buff *skb_share_check(struct sk_buff *skb, int pri) 473static inline struct sk_buff *skb_share_check(struct sk_buff *skb,
474 unsigned int __nocast pri)
469{ 475{
470 might_sleep_if(pri & __GFP_WAIT); 476 might_sleep_if(pri & __GFP_WAIT);
471 if (skb_shared(skb)) { 477 if (skb_shared(skb)) {
@@ -1002,7 +1008,7 @@ static inline void __skb_queue_purge(struct sk_buff_head *list)
1002 * %NULL is returned in there is no free memory. 1008 * %NULL is returned in there is no free memory.
1003 */ 1009 */
1004static inline struct sk_buff *__dev_alloc_skb(unsigned int length, 1010static inline struct sk_buff *__dev_alloc_skb(unsigned int length,
1005 int gfp_mask) 1011 unsigned int __nocast gfp_mask)
1006{ 1012{
1007 struct sk_buff *skb = alloc_skb(length + 16, gfp_mask); 1013 struct sk_buff *skb = alloc_skb(length + 16, gfp_mask);
1008 if (likely(skb)) 1014 if (likely(skb))
@@ -1115,8 +1121,8 @@ static inline int skb_can_coalesce(struct sk_buff *skb, int i,
1115 * If there is no free memory -ENOMEM is returned, otherwise zero 1121 * If there is no free memory -ENOMEM is returned, otherwise zero
1116 * is returned and the old skb data released. 1122 * is returned and the old skb data released.
1117 */ 1123 */
1118extern int __skb_linearize(struct sk_buff *skb, int gfp); 1124extern int __skb_linearize(struct sk_buff *skb, unsigned int __nocast gfp);
1119static inline int skb_linearize(struct sk_buff *skb, int gfp) 1125static inline int skb_linearize(struct sk_buff *skb, unsigned int __nocast gfp)
1120{ 1126{
1121 return __skb_linearize(skb, gfp); 1127 return __skb_linearize(skb, gfp);
1122} 1128}
@@ -1211,7 +1217,7 @@ static inline void *skb_header_pointer(const struct sk_buff *skb, int offset,
1211{ 1217{
1212 int hlen = skb_headlen(skb); 1218 int hlen = skb_headlen(skb);
1213 1219
1214 if (offset + len <= hlen) 1220 if (hlen - offset >= len)
1215 return skb->data + offset; 1221 return skb->data + offset;
1216 1222
1217 if (skb_copy_bits(skb, offset, buffer, len) < 0) 1223 if (skb_copy_bits(skb, offset, buffer, len) < 0)