]> www.pilppa.org Git - linux-2.6-omap-h63xx.git/commitdiff
[IPSEC]: Kill unused decap state argument
authorHerbert Xu <herbert@gondor.apana.org.au>
Sat, 1 Apr 2006 08:52:46 +0000 (00:52 -0800)
committerDavid S. Miller <davem@davemloft.net>
Sat, 1 Apr 2006 08:52:46 +0000 (00:52 -0800)
This patch removes the decap_state argument from the xfrm input hook.
Previously this function allowed the input hook to share state with
the post_input hook.  The latter has since been removed.

The only purpose for it now is to check the encap type.  However, it
is easier and better to move the encap type check to the generic
xfrm_rcv function.  This allows us to get rid of the decap state
argument altogether.

Signed-off-by: Herbert Xu <herbert@gondor.apana.org.au>
Signed-off-by: David S. Miller <davem@davemloft.net>
include/net/xfrm.h
net/ipv4/ah4.c
net/ipv4/esp4.c
net/ipv4/ipcomp.c
net/ipv4/xfrm4_input.c
net/ipv4/xfrm4_tunnel.c
net/ipv6/ah6.c
net/ipv6/esp6.c
net/ipv6/ipcomp6.c
net/ipv6/xfrm6_input.c
net/ipv6/xfrm6_tunnel.c

index e100291e43f4540c8ce83d3fbd85b8e092b181b1..c7612f4443ede6d9ebc111179e0ef75479d875c0 100644 (file)
@@ -251,7 +251,7 @@ struct xfrm_type
 
        int                     (*init_state)(struct xfrm_state *x);
        void                    (*destructor)(struct xfrm_state *);
-       int                     (*input)(struct xfrm_state *, struct xfrm_decap_state *, struct sk_buff *skb);
+       int                     (*input)(struct xfrm_state *, struct sk_buff *skb);
        int                     (*output)(struct xfrm_state *, struct sk_buff *pskb);
        /* Estimate maximal size of result of transformation of a dgram */
        u32                     (*get_max_size)(struct xfrm_state *, int size);
index e16d8b42b953bfd93de8be94b787353dfcc9f192..e2e4771fa4c6d42b8b7e19cdac07abd022e65b53 100644 (file)
@@ -116,7 +116,7 @@ error:
        return err;
 }
 
-static int ah_input(struct xfrm_state *x, struct xfrm_decap_state *decap, struct sk_buff *skb)
+static int ah_input(struct xfrm_state *x, struct sk_buff *skb)
 {
        int ah_hlen;
        struct iphdr *iph;
index bf88c620a954466de0e579505ed19e1a8f69b070..9d1881c07a32ae9dffcc1b0efa26bb2b5a698fda 100644 (file)
@@ -133,7 +133,7 @@ error:
  * expensive, so we only support truncated data, which is the recommended
  * and common case.
  */
-static int esp_input(struct xfrm_state *x, struct xfrm_decap_state *decap, struct sk_buff *skb)
+static int esp_input(struct xfrm_state *x, struct sk_buff *skb)
 {
        struct iphdr *iph;
        struct ip_esp_hdr *esph;
@@ -208,9 +208,6 @@ static int esp_input(struct xfrm_state *x, struct xfrm_decap_state *decap, struc
                struct xfrm_encap_tmpl *encap = x->encap;
                struct udphdr *uh;
 
-               if (encap->encap_type != decap->decap_type)
-                       goto out;
-
                uh = (struct udphdr *)(iph + 1);
                encap_len = (void*)esph - (void*)uh;
 
index c95020f7c81e38a2bdb0672fc7ecf5660c2f78d6..0a1d86a0f63289844a7dafccf5a726644ae38f45 100644 (file)
@@ -81,8 +81,7 @@ out:
        return err;
 }
 
-static int ipcomp_input(struct xfrm_state *x,
-                        struct xfrm_decap_state *decap, struct sk_buff *skb)
+static int ipcomp_input(struct xfrm_state *x, struct sk_buff *skb)
 {
        u8 nexthdr;
        int err = 0;
index 850d919591d1c817bc196407a90fd338ab0d2316..04ceb6e13b9d62e67c7ae05bbb27bc8408026921 100644 (file)
@@ -90,6 +90,9 @@ int xfrm4_rcv_encap(struct sk_buff *skb, __u16 encap_type)
                if (unlikely(x->km.state != XFRM_STATE_VALID))
                        goto drop_unlock;
 
+               if (x->encap->encap_type != encap_type)
+                       goto drop_unlock;
+
                if (x->props.replay_window && xfrm_replay_check(x, seq))
                        goto drop_unlock;
 
@@ -97,7 +100,7 @@ int xfrm4_rcv_encap(struct sk_buff *skb, __u16 encap_type)
                        goto drop_unlock;
 
                xfrm_vec[xfrm_nr].decap.decap_type = encap_type;
-               if (x->type->input(x, &(xfrm_vec[xfrm_nr].decap), skb))
+               if (x->type->input(x, skb))
                        goto drop_unlock;
 
                /* only the first xfrm gets the encap type */
index 2d670935c2b5cc3dc783c7e4a9fd90a88290c522..f8ceaa127c836d4bc6e626ae95eebf22f190a04d 100644 (file)
@@ -21,7 +21,7 @@ static int ipip_output(struct xfrm_state *x, struct sk_buff *skb)
        return 0;
 }
 
-static int ipip_xfrm_rcv(struct xfrm_state *x, struct xfrm_decap_state *decap, struct sk_buff *skb)
+static int ipip_xfrm_rcv(struct xfrm_state *x, struct sk_buff *skb)
 {
        return 0;
 }
index cf58251df4b328b5efbc6ab65430c6a87cf8c794..6778173a3dda85d666f1508c77aa7895dedd801a 100644 (file)
@@ -229,7 +229,7 @@ error:
        return err;
 }
 
-static int ah6_input(struct xfrm_state *x, struct xfrm_decap_state *decap, struct sk_buff *skb)
+static int ah6_input(struct xfrm_state *x, struct sk_buff *skb)
 {
        /*
         * Before process AH
index 3dcaac7a097238c599793b32380e410a420c6874..22f04607903759bd59eae8c1d11b49d3c58c1582 100644 (file)
@@ -130,7 +130,7 @@ error:
        return err;
 }
 
-static int esp6_input(struct xfrm_state *x, struct xfrm_decap_state *decap, struct sk_buff *skb)
+static int esp6_input(struct xfrm_state *x, struct sk_buff *skb)
 {
        struct ipv6hdr *iph;
        struct ipv6_esp_hdr *esph;
index d4cfec3f414e32bbd7c981437b1666c393369f4b..00f3fadfcca7f4f736d1038d2919ba3e8d668296 100644 (file)
@@ -63,7 +63,7 @@ static void **ipcomp6_scratches;
 static int ipcomp6_scratch_users;
 static LIST_HEAD(ipcomp6_tfms_list);
 
-static int ipcomp6_input(struct xfrm_state *x, struct xfrm_decap_state *decap, struct sk_buff *skb)
+static int ipcomp6_input(struct xfrm_state *x, struct sk_buff *skb)
 {
        int err = 0;
        u8 nexthdr = 0;
index cccf8b76f04671939b1310f327e2182588caa7e7..ec7a96e9fa644f63402a10d804e5b8fd383b23c5 100644 (file)
@@ -65,7 +65,7 @@ int xfrm6_rcv_spi(struct sk_buff *skb, u32 spi)
                if (xfrm_state_check_expire(x))
                        goto drop_unlock;
 
-               nexthdr = x->type->input(x, &(xfrm_vec[xfrm_nr].decap), skb);
+               nexthdr = x->type->input(x, skb);
                if (nexthdr <= 0)
                        goto drop_unlock;
 
index a8f6776c518d88235afb7b4aa2ee9a2a9024faeb..d37768e5064f8c77c9d9b84cb29917accd13d911 100644 (file)
@@ -351,7 +351,7 @@ static int xfrm6_tunnel_output(struct xfrm_state *x, struct sk_buff *skb)
        return 0;
 }
 
-static int xfrm6_tunnel_input(struct xfrm_state *x, struct xfrm_decap_state *decap, struct sk_buff *skb)
+static int xfrm6_tunnel_input(struct xfrm_state *x, struct sk_buff *skb)
 {
        return 0;
 }