diff options
Diffstat (limited to 'net/ipv4/ipcomp.c')
-rw-r--r-- | net/ipv4/ipcomp.c | 7 |
1 files changed, 5 insertions, 2 deletions
diff --git a/net/ipv4/ipcomp.c b/net/ipv4/ipcomp.c index f4af99ad8fdb..ae1f45fc23b9 100644 --- a/net/ipv4/ipcomp.c +++ b/net/ipv4/ipcomp.c | |||
@@ -74,6 +74,7 @@ out: | |||
74 | 74 | ||
75 | static int ipcomp_input(struct xfrm_state *x, struct sk_buff *skb) | 75 | static int ipcomp_input(struct xfrm_state *x, struct sk_buff *skb) |
76 | { | 76 | { |
77 | int nexthdr; | ||
77 | int err = -ENOMEM; | 78 | int err = -ENOMEM; |
78 | struct ip_comp_hdr *ipch; | 79 | struct ip_comp_hdr *ipch; |
79 | 80 | ||
@@ -84,13 +85,15 @@ static int ipcomp_input(struct xfrm_state *x, struct sk_buff *skb) | |||
84 | 85 | ||
85 | /* Remove ipcomp header and decompress original payload */ | 86 | /* Remove ipcomp header and decompress original payload */ |
86 | ipch = (void *)skb->data; | 87 | ipch = (void *)skb->data; |
88 | nexthdr = ipch->nexthdr; | ||
89 | |||
87 | skb->transport_header = skb->network_header + sizeof(*ipch); | 90 | skb->transport_header = skb->network_header + sizeof(*ipch); |
88 | __skb_pull(skb, sizeof(*ipch)); | 91 | __skb_pull(skb, sizeof(*ipch)); |
89 | err = ipcomp_decompress(x, skb); | 92 | err = ipcomp_decompress(x, skb); |
90 | if (err) | 93 | if (err) |
91 | goto out; | 94 | goto out; |
92 | 95 | ||
93 | err = ipch->nexthdr; | 96 | err = nexthdr; |
94 | 97 | ||
95 | out: | 98 | out: |
96 | return err; | 99 | return err; |
@@ -434,7 +437,7 @@ error: | |||
434 | goto out; | 437 | goto out; |
435 | } | 438 | } |
436 | 439 | ||
437 | static struct xfrm_type ipcomp_type = { | 440 | static const struct xfrm_type ipcomp_type = { |
438 | .description = "IPCOMP4", | 441 | .description = "IPCOMP4", |
439 | .owner = THIS_MODULE, | 442 | .owner = THIS_MODULE, |
440 | .proto = IPPROTO_COMP, | 443 | .proto = IPPROTO_COMP, |