aboutsummaryrefslogtreecommitdiffstats
path: root/include
diff options
context:
space:
mode:
authorLinus Torvalds <torvalds@woody.linux-foundation.org>2007-11-14 21:51:48 -0500
committerLinus Torvalds <torvalds@woody.linux-foundation.org>2007-11-14 21:51:48 -0500
commit6f37ac793d6ba7b35d338f791974166f67fdd9ba (patch)
treece7e05fc4ede544021f4e395346a87f649f581f7 /include
parent2f1f53bdc6531696934f6ee7bbdfa2ab4f4f62a3 (diff)
parentd90bf5a976793edfa88d3bb2393f0231eb8ce1e5 (diff)
Merge branch 'master' of master.kernel.org:/pub/scm/linux/kernel/git/davem/net-2.6
* 'master' of master.kernel.org:/pub/scm/linux/kernel/git/davem/net-2.6: [NET]: rt_check_expire() can take a long time, add a cond_resched() [ISDN] sc: Really, really fix warning [ISDN] sc: Fix sndpkt to have the correct number of arguments [TCP] FRTO: Clear frto_highmark only after process_frto that uses it [NET]: Remove notifier block from chain when register_netdevice_notifier fails [FS_ENET]: Fix module build. [TCP]: Make sure write_queue_from does not begin with NULL ptr [TCP]: Fix size calculation in sk_stream_alloc_pskb [S2IO]: Fixed memory leak when MSI-X vector allocation fails [BONDING]: Fix resource use after free [SYSCTL]: Fix warning for token-ring from sysctl checker [NET] random : secure_tcp_sequence_number should not assume CONFIG_KTIME_SCALAR [IWLWIFI]: Not correctly dealing with hotunplug. [TCP] FRTO: Plug potential LOST-bit leak [TCP] FRTO: Limit snd_cwnd if TCP was application limited [E1000]: Fix schedule while atomic when called from mii-tool. [NETX]: Fix build failure added by 2.6.24 statistics cleanup. [EP93xx_ETH]: Build fix after 2.6.24 NAPI changes. [PKT_SCHED]: Check subqueue status before calling hard_start_xmit
Diffstat (limited to 'include')
-rw-r--r--include/net/sock.h10
1 files changed, 6 insertions, 4 deletions
diff --git a/include/net/sock.h b/include/net/sock.h
index 5504fb9fa88a..567e468d7492 100644
--- a/include/net/sock.h
+++ b/include/net/sock.h
@@ -1235,14 +1235,16 @@ static inline struct sk_buff *sk_stream_alloc_pskb(struct sock *sk,
1235 gfp_t gfp) 1235 gfp_t gfp)
1236{ 1236{
1237 struct sk_buff *skb; 1237 struct sk_buff *skb;
1238 int hdr_len;
1239 1238
1240 hdr_len = SKB_DATA_ALIGN(sk->sk_prot->max_header); 1239 skb = alloc_skb_fclone(size + sk->sk_prot->max_header, gfp);
1241 skb = alloc_skb_fclone(size + hdr_len, gfp);
1242 if (skb) { 1240 if (skb) {
1243 skb->truesize += mem; 1241 skb->truesize += mem;
1244 if (sk_stream_wmem_schedule(sk, skb->truesize)) { 1242 if (sk_stream_wmem_schedule(sk, skb->truesize)) {
1245 skb_reserve(skb, hdr_len); 1243 /*
1244 * Make sure that we have exactly size bytes
1245 * available to the caller, no more, no less.
1246 */
1247 skb_reserve(skb, skb_tailroom(skb) - size);
1246 return skb; 1248 return skb;
1247 } 1249 }
1248 __kfree_skb(skb); 1250 __kfree_skb(skb);