linux 2.6.16.38 w/ vs2.0.3-rc1
[linux-2.6.git] / net / ipv4 / esp4.c
index 9d1881c..09590f3 100644 (file)
@@ -90,7 +90,6 @@ static int esp_output(struct xfrm_state *x, struct sk_buff *skb)
 
        esph->spi = x->id.spi;
        esph->seq_no = htonl(++x->replay.oseq);
-       xfrm_aevent_doreplay(x);
 
        if (esp->conf.ivlen)
                crypto_cipher_set_iv(tfm, esp->conf.ivec, crypto_tfm_alg_ivsize(tfm));
@@ -133,7 +132,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 sk_buff *skb)
+static int esp_input(struct xfrm_state *x, struct xfrm_decap_state *decap, struct sk_buff *skb)
 {
        struct iphdr *iph;
        struct ip_esp_hdr *esph;
@@ -208,6 +207,9 @@ static int esp_input(struct xfrm_state *x, struct sk_buff *skb)
                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;