diff options
-rw-r--r-- | net/ipv4/tcp.c | 14 |
1 files changed, 10 insertions, 4 deletions
diff --git a/net/ipv4/tcp.c b/net/ipv4/tcp.c index 0336422c88a0..0bb0ac96d675 100644 --- a/net/ipv4/tcp.c +++ b/net/ipv4/tcp.c | |||
@@ -2166,13 +2166,19 @@ struct sk_buff *tcp_tso_segment(struct sk_buff *skb, int features) | |||
2166 | if (!pskb_may_pull(skb, thlen)) | 2166 | if (!pskb_may_pull(skb, thlen)) |
2167 | goto out; | 2167 | goto out; |
2168 | 2168 | ||
2169 | segs = NULL; | ||
2170 | if (skb_gso_ok(skb, features | NETIF_F_GSO_ROBUST)) | ||
2171 | goto out; | ||
2172 | |||
2173 | oldlen = (u16)~skb->len; | 2169 | oldlen = (u16)~skb->len; |
2174 | __skb_pull(skb, thlen); | 2170 | __skb_pull(skb, thlen); |
2175 | 2171 | ||
2172 | if (skb_gso_ok(skb, features | NETIF_F_GSO_ROBUST)) { | ||
2173 | /* Packet is from an untrusted source, reset gso_segs. */ | ||
2174 | int mss = skb_shinfo(skb)->gso_size; | ||
2175 | |||
2176 | skb_shinfo(skb)->gso_segs = (skb->len + mss - 1) / mss; | ||
2177 | |||
2178 | segs = NULL; | ||
2179 | goto out; | ||
2180 | } | ||
2181 | |||
2176 | segs = skb_segment(skb, features); | 2182 | segs = skb_segment(skb, features); |
2177 | if (IS_ERR(segs)) | 2183 | if (IS_ERR(segs)) |
2178 | goto out; | 2184 | goto out; |