Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 278366
b: refs/heads/master
c: 4fa48bf
h: refs/heads/master
v: v3
  • Loading branch information
Eric Dumazet authored and David S. Miller committed Dec 5, 2011
1 parent ca2b57d commit 50fa979
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 6 deletions.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: 7d3113042823344dcc175b0ea00a83d0273c98a4
refs/heads/master: 4fa48bf3c75069d636fc8830743c929a062e80dc
13 changes: 8 additions & 5 deletions trunk/net/ipv4/tcp_output.c
Original file line number Diff line number Diff line change
Expand Up @@ -1093,6 +1093,13 @@ static void __pskb_trim_head(struct sk_buff *skb, int len)
{
int i, k, eat;

eat = min_t(int, len, skb_headlen(skb));
if (eat) {
__skb_pull(skb, eat);
len -= eat;
if (!len)
return;
}
eat = len;
k = 0;
for (i = 0; i < skb_shinfo(skb)->nr_frags; i++) {
Expand Down Expand Up @@ -1124,11 +1131,7 @@ int tcp_trim_head(struct sock *sk, struct sk_buff *skb, u32 len)
if (skb_cloned(skb) && pskb_expand_head(skb, 0, 0, GFP_ATOMIC))
return -ENOMEM;

/* If len == headlen, we avoid __skb_pull to preserve alignment. */
if (unlikely(len < skb_headlen(skb)))
__skb_pull(skb, len);
else
__pskb_trim_head(skb, len - skb_headlen(skb));
__pskb_trim_head(skb, len);

TCP_SKB_CB(skb)->seq += len;
skb->ip_summed = CHECKSUM_PARTIAL;
Expand Down

0 comments on commit 50fa979

Please sign in to comment.