summaryrefslogtreecommitdiffstats
path: root/net/ipv4
diff options
context:
space:
mode:
authorArnaldo Carvalho de Melo2007-03-10 16:47:22 +0100
committerDavid S. Miller2007-04-26 07:24:38 +0200
commitc51957dafa6f960c5c6372aa3da6c8fa71c13730 (patch)
tree674537df214b57e96660ffd59e2c44616c9ea57a /net/ipv4
parent[SK_BUFF] xfrm: Use skb_set_mac_header in the memmove cases (diff)
downloadkernel-qcow2-linux-c51957dafa6f960c5c6372aa3da6c8fa71c13730.tar.gz
kernel-qcow2-linux-c51957dafa6f960c5c6372aa3da6c8fa71c13730.tar.xz
kernel-qcow2-linux-c51957dafa6f960c5c6372aa3da6c8fa71c13730.zip
[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: Arnaldo Carvalho de Melo <acme@redhat.com> Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'net/ipv4')
-rw-r--r--net/ipv4/tcp_input.c8
1 files changed, 5 insertions, 3 deletions
diff --git a/net/ipv4/tcp_input.c b/net/ipv4/tcp_input.c
index fb0256085948..e5d1c2c8cea7 100644
--- a/net/ipv4/tcp_input.c
+++ b/net/ipv4/tcp_input.c
@@ -3632,11 +3632,13 @@ tcp_collapse(struct sock *sk, struct sk_buff_head *list,
nskb = alloc_skb(copy+header, GFP_ATOMIC);
if (!nskb)
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);
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));
TCP_SKB_CB(nskb)->seq = TCP_SKB_CB(nskb)->end_seq = start;
__skb_insert(nskb, skb->prev, skb, list);