Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 129771
b: refs/heads/master
c: 4e704ee
h: refs/heads/master
i:
  129769: 3a47af6
  129767: 9b825f5
v: v3
  • Loading branch information
Herbert Xu authored and David S. Miller committed Jan 15, 2009
1 parent b366aeb commit c5c11ba
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 7 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: f557206800801410c30e53ce7a27219b2c4cf0ba
refs/heads/master: 4e704ee3c2cd38748ca59d835435d6a7e7f6f613
13 changes: 7 additions & 6 deletions trunk/net/ipv4/tcp.c
Original file line number Diff line number Diff line change
Expand Up @@ -2389,7 +2389,7 @@ struct sk_buff *tcp_tso_segment(struct sk_buff *skb, int features)
unsigned int seq;
__be32 delta;
unsigned int oldlen;
unsigned int len;
unsigned int mss;

if (!pskb_may_pull(skb, sizeof(*th)))
goto out;
Expand All @@ -2405,10 +2405,13 @@ struct sk_buff *tcp_tso_segment(struct sk_buff *skb, int features)
oldlen = (u16)~skb->len;
__skb_pull(skb, thlen);

mss = skb_shinfo(skb)->gso_size;
if (unlikely(skb->len <= mss))
goto out;

if (skb_gso_ok(skb, features | NETIF_F_GSO_ROBUST)) {
/* Packet is from an untrusted source, reset gso_segs. */
int type = skb_shinfo(skb)->gso_type;
int mss;

if (unlikely(type &
~(SKB_GSO_TCPV4 |
Expand All @@ -2419,7 +2422,6 @@ struct sk_buff *tcp_tso_segment(struct sk_buff *skb, int features)
!(type & (SKB_GSO_TCPV4 | SKB_GSO_TCPV6))))
goto out;

mss = skb_shinfo(skb)->gso_size;
skb_shinfo(skb)->gso_segs = DIV_ROUND_UP(skb->len, mss);

segs = NULL;
Expand All @@ -2430,8 +2432,7 @@ struct sk_buff *tcp_tso_segment(struct sk_buff *skb, int features)
if (IS_ERR(segs))
goto out;

len = skb_shinfo(skb)->gso_size;
delta = htonl(oldlen + (thlen + len));
delta = htonl(oldlen + (thlen + mss));

skb = segs;
th = tcp_hdr(skb);
Expand All @@ -2447,7 +2448,7 @@ struct sk_buff *tcp_tso_segment(struct sk_buff *skb, int features)
csum_fold(csum_partial(skb_transport_header(skb),
thlen, skb->csum));

seq += len;
seq += mss;
skb = skb->next;
th = tcp_hdr(skb);

Expand Down

0 comments on commit c5c11ba

Please sign in to comment.