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.c7
1 files changed, 4 insertions, 3 deletions
diff --git a/net/ipv4/ipcomp.c b/net/ipv4/ipcomp.c
index 32b02deca2ec..0bfeb02a5f87 100644
--- a/net/ipv4/ipcomp.c
+++ b/net/ipv4/ipcomp.c
@@ -75,7 +75,6 @@ out:
75static int ipcomp_input(struct xfrm_state *x, struct sk_buff *skb) 75static int ipcomp_input(struct xfrm_state *x, struct sk_buff *skb)
76{ 76{
77 int err = -ENOMEM; 77 int err = -ENOMEM;
78 struct iphdr *iph;
79 struct ip_comp_hdr *ipch; 78 struct ip_comp_hdr *ipch;
80 79
81 if (skb_linearize_cow(skb)) 80 if (skb_linearize_cow(skb))
@@ -84,12 +83,14 @@ static int ipcomp_input(struct xfrm_state *x, struct sk_buff *skb)
84 skb->ip_summed = CHECKSUM_NONE; 83 skb->ip_summed = CHECKSUM_NONE;
85 84
86 /* Remove ipcomp header and decompress original payload */ 85 /* Remove ipcomp header and decompress original payload */
87 iph = ip_hdr(skb);
88 ipch = (void *)skb->data; 86 ipch = (void *)skb->data;
89 iph->protocol = ipch->nexthdr;
90 skb->transport_header = skb->network_header + sizeof(*ipch); 87 skb->transport_header = skb->network_header + sizeof(*ipch);
91 __skb_pull(skb, sizeof(*ipch)); 88 __skb_pull(skb, sizeof(*ipch));
92 err = ipcomp_decompress(x, skb); 89 err = ipcomp_decompress(x, skb);
90 if (err)
91 goto out;
92
93 err = ipch->nexthdr;
93 94
94out: 95out:
95 return err; 96 return err;