]> err.no Git - linux-2.6/blobdiff - net/ipv4/xfrm4_mode_transport.c
Merge master.kernel.org:/pub/scm/linux/kernel/git/kyle/parisc-2.6
[linux-2.6] / net / ipv4 / xfrm4_mode_transport.c
index e46d9a4ccc55f8c062e4ce0dec6dca19ee609194..a9e6b3dd19c9b9f5c4b5c371bbf6c0cd03c2b629 100644 (file)
@@ -38,8 +38,22 @@ static int xfrm4_transport_output(struct sk_buff *skb)
        return 0;
 }
 
+/* Remove encapsulation header.
+ *
+ * The IP header will be moved over the top of the encapsulation header.
+ *
+ * On entry, skb->h shall point to where the IP header should be and skb->nh
+ * shall be set to where the IP header currently is.  skb->data shall point
+ * to the start of the payload.
+ */
 static int xfrm4_transport_input(struct xfrm_state *x, struct sk_buff *skb)
 {
+       int ihl = skb->data - skb->h.raw;
+
+       if (skb->h.raw != skb->nh.raw)
+               skb->nh.raw = memmove(skb->h.raw, skb->nh.raw, ihl);
+       skb->nh.iph->tot_len = htons(skb->len + ihl);
+       skb->h.raw = skb->data;
        return 0;
 }