diff options
Diffstat (limited to 'net/ipv4/tcp_output.c')
-rw-r--r-- | net/ipv4/tcp_output.c | 14 |
1 files changed, 9 insertions, 5 deletions
diff --git a/net/ipv4/tcp_output.c b/net/ipv4/tcp_output.c index e6bb8256e59f..d46f2143305c 100644 --- a/net/ipv4/tcp_output.c +++ b/net/ipv4/tcp_output.c | |||
@@ -637,6 +637,8 @@ static unsigned int tcp_established_options(struct sock *sk, struct sk_buff *skb | |||
637 | unsigned int size = 0; | 637 | unsigned int size = 0; |
638 | unsigned int eff_sacks; | 638 | unsigned int eff_sacks; |
639 | 639 | ||
640 | opts->options = 0; | ||
641 | |||
640 | #ifdef CONFIG_TCP_MD5SIG | 642 | #ifdef CONFIG_TCP_MD5SIG |
641 | *md5 = tp->af_specific->md5_lookup(sk, sk); | 643 | *md5 = tp->af_specific->md5_lookup(sk, sk); |
642 | if (unlikely(*md5)) { | 644 | if (unlikely(*md5)) { |
@@ -984,8 +986,10 @@ static void tcp_queue_skb(struct sock *sk, struct sk_buff *skb) | |||
984 | static void tcp_set_skb_tso_segs(const struct sock *sk, struct sk_buff *skb, | 986 | static void tcp_set_skb_tso_segs(const struct sock *sk, struct sk_buff *skb, |
985 | unsigned int mss_now) | 987 | unsigned int mss_now) |
986 | { | 988 | { |
987 | if (skb->len <= mss_now || !sk_can_gso(sk) || | 989 | /* Make sure we own this skb before messing gso_size/gso_segs */ |
988 | skb->ip_summed == CHECKSUM_NONE) { | 990 | WARN_ON_ONCE(skb_cloned(skb)); |
991 | |||
992 | if (skb->len <= mss_now || skb->ip_summed == CHECKSUM_NONE) { | ||
989 | /* Avoid the costly divide in the normal | 993 | /* Avoid the costly divide in the normal |
990 | * non-TSO case. | 994 | * non-TSO case. |
991 | */ | 995 | */ |
@@ -1065,9 +1069,7 @@ int tcp_fragment(struct sock *sk, struct sk_buff *skb, u32 len, | |||
1065 | if (nsize < 0) | 1069 | if (nsize < 0) |
1066 | nsize = 0; | 1070 | nsize = 0; |
1067 | 1071 | ||
1068 | if (skb_cloned(skb) && | 1072 | if (skb_unclone(skb, GFP_ATOMIC)) |
1069 | skb_is_nonlinear(skb) && | ||
1070 | pskb_expand_head(skb, 0, 0, GFP_ATOMIC)) | ||
1071 | return -ENOMEM; | 1073 | return -ENOMEM; |
1072 | 1074 | ||
1073 | /* Get a new skb... force flag on. */ | 1075 | /* Get a new skb... force flag on. */ |
@@ -2342,6 +2344,8 @@ int __tcp_retransmit_skb(struct sock *sk, struct sk_buff *skb) | |||
2342 | int oldpcount = tcp_skb_pcount(skb); | 2344 | int oldpcount = tcp_skb_pcount(skb); |
2343 | 2345 | ||
2344 | if (unlikely(oldpcount > 1)) { | 2346 | if (unlikely(oldpcount > 1)) { |
2347 | if (skb_unclone(skb, GFP_ATOMIC)) | ||
2348 | return -ENOMEM; | ||
2345 | tcp_init_tso_segs(sk, skb, cur_mss); | 2349 | tcp_init_tso_segs(sk, skb, cur_mss); |
2346 | tcp_adjust_pcount(sk, skb, oldpcount - tcp_skb_pcount(skb)); | 2350 | tcp_adjust_pcount(sk, skb, oldpcount - tcp_skb_pcount(skb)); |
2347 | } | 2351 | } |