aboutsummaryrefslogtreecommitdiffstats
path: root/net/ipv4/ipcomp.c
diff options
context:
space:
mode:
Diffstat (limited to 'net/ipv4/ipcomp.c')
-rw-r--r--net/ipv4/ipcomp.c10
1 files changed, 5 insertions, 5 deletions
diff --git a/net/ipv4/ipcomp.c b/net/ipv4/ipcomp.c
index 1929d451dab5..bf74f64fe5fb 100644
--- a/net/ipv4/ipcomp.c
+++ b/net/ipv4/ipcomp.c
@@ -98,10 +98,10 @@ out:
98static int ipcomp_compress(struct xfrm_state *x, struct sk_buff *skb) 98static int ipcomp_compress(struct xfrm_state *x, struct sk_buff *skb)
99{ 99{
100 struct ipcomp_data *ipcd = x->data; 100 struct ipcomp_data *ipcd = x->data;
101 const int ihlen = ip_hdrlen(skb); 101 const int ihlen = skb_transport_offset(skb);
102 const int plen = skb->len - ihlen; 102 const int plen = skb->len - ihlen;
103 int dlen = IPCOMP_SCRATCH_SIZE; 103 int dlen = IPCOMP_SCRATCH_SIZE;
104 u8 *start = skb->data + ihlen; 104 u8 *start = skb_transport_header(skb);
105 const int cpu = get_cpu(); 105 const int cpu = get_cpu();
106 u8 *scratch = *per_cpu_ptr(ipcomp_scratches, cpu); 106 u8 *scratch = *per_cpu_ptr(ipcomp_scratches, cpu);
107 struct crypto_comp *tfm = *per_cpu_ptr(ipcd->tfms, cpu); 107 struct crypto_comp *tfm = *per_cpu_ptr(ipcd->tfms, cpu);
@@ -154,11 +154,11 @@ static int ipcomp_output(struct xfrm_state *x, struct sk_buff *skb)
154 154
155 /* Install ipcomp header, convert into ipcomp datagram. */ 155 /* Install ipcomp header, convert into ipcomp datagram. */
156 iph->tot_len = htons(skb->len); 156 iph->tot_len = htons(skb->len);
157 ipch = (struct ip_comp_hdr *)((char *)iph + iph->ihl * 4); 157 ipch = (struct ip_comp_hdr *)skb_transport_header(skb);
158 ipch->nexthdr = iph->protocol; 158 ipch->nexthdr = *skb_mac_header(skb);
159 ipch->flags = 0; 159 ipch->flags = 0;
160 ipch->cpi = htons((u16 )ntohl(x->id.spi)); 160 ipch->cpi = htons((u16 )ntohl(x->id.spi));
161 iph->protocol = IPPROTO_COMP; 161 *skb_mac_header(skb) = IPPROTO_COMP;
162 ip_send_check(iph); 162 ip_send_check(iph);
163 return 0; 163 return 0;
164 164