diff options
Diffstat (limited to 'net/core/skbuff.c')
-rw-r--r-- | net/core/skbuff.c | 18 |
1 files changed, 8 insertions, 10 deletions
diff --git a/net/core/skbuff.c b/net/core/skbuff.c index d0732e9c8560..2144952d1c6c 100644 --- a/net/core/skbuff.c +++ b/net/core/skbuff.c | |||
@@ -135,13 +135,15 @@ void skb_under_panic(struct sk_buff *skb, int sz, void *here) | |||
135 | struct sk_buff *__alloc_skb(unsigned int size, gfp_t gfp_mask, | 135 | struct sk_buff *__alloc_skb(unsigned int size, gfp_t gfp_mask, |
136 | int fclone) | 136 | int fclone) |
137 | { | 137 | { |
138 | kmem_cache_t *cache; | ||
138 | struct skb_shared_info *shinfo; | 139 | struct skb_shared_info *shinfo; |
139 | struct sk_buff *skb; | 140 | struct sk_buff *skb; |
140 | u8 *data; | 141 | u8 *data; |
141 | 142 | ||
143 | cache = fclone ? skbuff_fclone_cache : skbuff_head_cache; | ||
144 | |||
142 | /* Get the HEAD */ | 145 | /* Get the HEAD */ |
143 | skb = kmem_cache_alloc(fclone ? skbuff_fclone_cache : skbuff_head_cache, | 146 | skb = kmem_cache_alloc(cache, gfp_mask & ~__GFP_DMA); |
144 | gfp_mask & ~__GFP_DMA); | ||
145 | if (!skb) | 147 | if (!skb) |
146 | goto out; | 148 | goto out; |
147 | 149 | ||
@@ -180,7 +182,7 @@ struct sk_buff *__alloc_skb(unsigned int size, gfp_t gfp_mask, | |||
180 | out: | 182 | out: |
181 | return skb; | 183 | return skb; |
182 | nodata: | 184 | nodata: |
183 | kmem_cache_free(skbuff_head_cache, skb); | 185 | kmem_cache_free(cache, skb); |
184 | skb = NULL; | 186 | skb = NULL; |
185 | goto out; | 187 | goto out; |
186 | } | 188 | } |
@@ -409,6 +411,9 @@ struct sk_buff *skb_clone(struct sk_buff *skb, gfp_t gfp_mask) | |||
409 | C(pkt_type); | 411 | C(pkt_type); |
410 | C(ip_summed); | 412 | C(ip_summed); |
411 | C(priority); | 413 | C(priority); |
414 | #if defined(CONFIG_IP_VS) || defined(CONFIG_IP_VS_MODULE) | ||
415 | C(ipvs_property); | ||
416 | #endif | ||
412 | C(protocol); | 417 | C(protocol); |
413 | n->destructor = NULL; | 418 | n->destructor = NULL; |
414 | #ifdef CONFIG_NETFILTER | 419 | #ifdef CONFIG_NETFILTER |
@@ -420,13 +425,6 @@ struct sk_buff *skb_clone(struct sk_buff *skb, gfp_t gfp_mask) | |||
420 | C(nfct_reasm); | 425 | C(nfct_reasm); |
421 | nf_conntrack_get_reasm(skb->nfct_reasm); | 426 | nf_conntrack_get_reasm(skb->nfct_reasm); |
422 | #endif | 427 | #endif |
423 | #if defined(CONFIG_IP_VS) || defined(CONFIG_IP_VS_MODULE) | ||
424 | C(ipvs_property); | ||
425 | #endif | ||
426 | #if defined(CONFIG_NF_CONNTRACK) || defined(CONFIG_NF_CONNTRACK_MODULE) | ||
427 | C(nfct_reasm); | ||
428 | nf_conntrack_get_reasm(skb->nfct_reasm); | ||
429 | #endif | ||
430 | #ifdef CONFIG_BRIDGE_NETFILTER | 428 | #ifdef CONFIG_BRIDGE_NETFILTER |
431 | C(nf_bridge); | 429 | C(nf_bridge); |
432 | nf_bridge_get(skb->nf_bridge); | 430 | nf_bridge_get(skb->nf_bridge); |