Commit c51957da authored by Arnaldo Carvalho de Melo's avatar Arnaldo Carvalho de Melo Committed by David S. Miller

[TCP]: Do the layer header setting in tcp_collapse relative to skb->data

That is equal to skb->head before skb_reserve, to help in the layer header
changes.
Signed-off-by: default avatarArnaldo Carvalho de Melo <acme@redhat.com>
Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
parent 39f69c6f
...@@ -3632,11 +3632,13 @@ tcp_collapse(struct sock *sk, struct sk_buff_head *list, ...@@ -3632,11 +3632,13 @@ tcp_collapse(struct sock *sk, struct sk_buff_head *list,
nskb = alloc_skb(copy+header, GFP_ATOMIC); nskb = alloc_skb(copy+header, GFP_ATOMIC);
if (!nskb) if (!nskb)
return; return;
nskb->mac.raw = nskb->data + (skb->mac.raw - skb->head);
nskb->nh.raw = nskb->data + (skb->nh.raw - skb->head);
nskb->h.raw = nskb->data + (skb->h.raw - skb->head);
skb_reserve(nskb, header); skb_reserve(nskb, header);
memcpy(nskb->head, skb->head, header); memcpy(nskb->head, skb->head, header);
nskb->nh.raw = nskb->head + (skb->nh.raw-skb->head);
nskb->h.raw = nskb->head + (skb->h.raw-skb->head);
nskb->mac.raw = nskb->head + (skb->mac.raw-skb->head);
memcpy(nskb->cb, skb->cb, sizeof(skb->cb)); memcpy(nskb->cb, skb->cb, sizeof(skb->cb));
TCP_SKB_CB(nskb)->seq = TCP_SKB_CB(nskb)->end_seq = start; TCP_SKB_CB(nskb)->seq = TCP_SKB_CB(nskb)->end_seq = start;
__skb_insert(nskb, skb->prev, skb, list); __skb_insert(nskb, skb->prev, skb, list);
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment