aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--net/ipv4/tcp_input.c17
1 files changed, 2 insertions, 15 deletions
diff --git a/net/ipv4/tcp_input.c b/net/ipv4/tcp_input.c
index 228bf0c5ff19..ea92f23ffaf1 100644
--- a/net/ipv4/tcp_input.c
+++ b/net/ipv4/tcp_input.c
@@ -4535,26 +4535,13 @@ restart:
4535 return; 4535 return;
4536 4536
4537 while (before(start, end)) { 4537 while (before(start, end)) {
4538 int copy = min_t(int, SKB_MAX_ORDER(0, 0), end - start);
4538 struct sk_buff *nskb; 4539 struct sk_buff *nskb;
4539 unsigned int header = skb_headroom(skb);
4540 int copy = SKB_MAX_ORDER(header, 0);
4541 4540
4542 /* Too big header? This can happen with IPv6. */ 4541 nskb = alloc_skb(copy, GFP_ATOMIC);
4543 if (copy < 0)
4544 return;
4545 if (end - start < copy)
4546 copy = end - start;
4547 nskb = alloc_skb(copy + header, GFP_ATOMIC);
4548 if (!nskb) 4542 if (!nskb)
4549 return; 4543 return;
4550 4544
4551 skb_set_mac_header(nskb, skb_mac_header(skb) - skb->head);
4552 skb_set_network_header(nskb, (skb_network_header(skb) -
4553 skb->head));
4554 skb_set_transport_header(nskb, (skb_transport_header(skb) -
4555 skb->head));
4556 skb_reserve(nskb, header);
4557 memcpy(nskb->head, skb->head, header);
4558 memcpy(nskb->cb, skb->cb, sizeof(skb->cb)); 4545 memcpy(nskb->cb, skb->cb, sizeof(skb->cb));
4559 TCP_SKB_CB(nskb)->seq = TCP_SKB_CB(nskb)->end_seq = start; 4546 TCP_SKB_CB(nskb)->seq = TCP_SKB_CB(nskb)->end_seq = start;
4560 __skb_queue_before(list, skb, nskb); 4547 __skb_queue_before(list, skb, nskb);