]> err.no Git - linux-2.6/blobdiff - net/xfrm/xfrm_input.c
Merge branch 'async-tx-for-linus' of git://lost.foo-projects.org/~dwillia2/git/iop...
[linux-2.6] / net / xfrm / xfrm_input.c
index 493243fc5fe5d8db1efbba92991d98493676e4a7..4d6ebc633a944d14a328606ee675ae5cc528e191 100644 (file)
@@ -81,7 +81,6 @@ int xfrm_parse_spi(struct sk_buff *skb, u8 nexthdr, __be32 *spi, __be32 *seq)
        *seq = *(__be32*)(skb_transport_header(skb) + offset_seq);
        return 0;
 }
-EXPORT_SYMBOL(xfrm_parse_spi);
 
 int xfrm_prepare_input(struct xfrm_state *x, struct sk_buff *skb)
 {
@@ -147,6 +146,7 @@ int xfrm_input(struct sk_buff *skb, int nexthdr, __be32 spi, int encap_type)
                x = xfrm_state_lookup(daddr, spi, nexthdr, family);
                if (x == NULL) {
                        XFRM_INC_STATS(LINUX_MIB_XFRMINNOSTATES);
+                       xfrm_audit_state_notfound(skb, family, spi, seq);
                        goto drop;
                }
 
@@ -159,12 +159,12 @@ int xfrm_input(struct sk_buff *skb, int nexthdr, __be32 spi, int encap_type)
                }
 
                if ((x->encap ? x->encap->encap_type : 0) != encap_type) {
-                       XFRM_INC_STATS(LINUX_MIB_XFRMINSTATEINVALID);
+                       XFRM_INC_STATS(LINUX_MIB_XFRMINSTATEMISMATCH);
                        goto drop_unlock;
                }
 
-               if (x->props.replay_window && xfrm_replay_check(x, seq)) {
-                       XFRM_INC_STATS(LINUX_MIB_XFRMINSEQOUTOFWINDOW);
+               if (x->props.replay_window && xfrm_replay_check(x, skb, seq)) {
+                       XFRM_INC_STATS(LINUX_MIB_XFRMINSTATESEQERROR);
                        goto drop_unlock;
                }
 
@@ -185,8 +185,11 @@ int xfrm_input(struct sk_buff *skb, int nexthdr, __be32 spi, int encap_type)
 resume:
                spin_lock(&x->lock);
                if (nexthdr <= 0) {
-                       if (nexthdr == -EBADMSG)
+                       if (nexthdr == -EBADMSG) {
+                               xfrm_audit_state_icvfail(x, skb,
+                                                        x->type->proto);
                                x->stats.integrity_failed++;
+                       }
                        XFRM_INC_STATS(LINUX_MIB_XFRMINSTATEPROTOERROR);
                        goto drop_unlock;
                }