diff options
author | Herbert Xu <herbert@gondor.apana.org.au> | 2007-10-10 18:46:21 -0400 |
---|---|---|
committer | David S. Miller <davem@sunset.davemloft.net> | 2007-10-10 19:55:56 -0400 |
commit | 631a6698d09e57cadc069914d613899609a0ae83 (patch) | |
tree | 7e915991e7dea60077e2f160908820c90e34fb18 /net/ipv4/ipcomp.c | |
parent | ceb1eec8291175686d0208e66595ff83bc0624e2 (diff) |
[IPSEC]: Move IP protocol setting from transforms into xfrm4_input.c
This patch makes the IPv4 x->type->input functions return the next protocol
instead of setting it directly. This is identical to how we do things in
IPv6 and will help us merge common code on the input path.
Signed-off-by: Herbert Xu <herbert@gondor.apana.org.au>
Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'net/ipv4/ipcomp.c')
-rw-r--r-- | net/ipv4/ipcomp.c | 7 |
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: | |||
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 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 | ||
94 | out: | 95 | out: |
95 | return err; | 96 | return err; |