]> pilppa.com Git - linux-2.6-omap-h63xx.git/commitdiff
[XFRM]: Fix statistics.
authorMasahide NAKAMURA <nakam@linux-ipv6.org>
Fri, 1 Feb 2008 01:14:58 +0000 (17:14 -0800)
committerDavid S. Miller <davem@davemloft.net>
Fri, 1 Feb 2008 03:28:30 +0000 (19:28 -0800)
o Outbound sequence number overflow error status
  is counted as XfrmOutStateSeqError.
o Additionaly, it changes inbound sequence number replay
  error name from XfrmInSeqOutOfWindow to XfrmInStateSeqError
  to apply name scheme above.
o Inbound IPv4 UDP encapsuling type mismatch error is wrongly
  mapped to XfrmInStateInvalid then this patch fiex the error
  to XfrmInStateMismatch.

Signed-off-by: Masahide NAKAMURA <nakam@linux-ipv6.org>
Signed-off-by: David S. Miller <davem@davemloft.net>
Documentation/networking/xfrm_proc.txt
include/linux/snmp.h
net/xfrm/xfrm_input.c
net/xfrm/xfrm_output.c
net/xfrm/xfrm_proc.c

index 53c1a58b02f1b3b5cf4010a693ba2cef496fc010..d0d8bafa9016b7f435ac5529ca6d6e1c736b42dc 100644 (file)
@@ -26,8 +26,9 @@ XfrmInStateProtoError:
        e.g. SA key is wrong
 XfrmInStateModeError:
        Transformation mode specific error
-XfrmInSeqOutOfWindow:
-       Sequence out of window
+XfrmInStateSeqError:
+       Sequence error
+       i.e. Sequence number is out of window
 XfrmInStateExpired:
        State is expired
 XfrmInStateMismatch:
@@ -60,6 +61,9 @@ XfrmOutStateProtoError:
        Transformation protocol specific error
 XfrmOutStateModeError:
        Transformation mode specific error
+XfrmOutStateSeqError:
+       Sequence error
+       i.e. Sequence number overflow
 XfrmOutStateExpired:
        State is expired
 XfrmOutPolBlock:
index 86d3effb283626f8b053db379ceacca52c6bef06..5df62ef1280c176d2299d61dd6e3148161bd3b63 100644 (file)
@@ -227,7 +227,7 @@ enum
        LINUX_MIB_XFRMINNOSTATES,               /* XfrmInNoStates */
        LINUX_MIB_XFRMINSTATEPROTOERROR,        /* XfrmInStateProtoError */
        LINUX_MIB_XFRMINSTATEMODEERROR,         /* XfrmInStateModeError */
-       LINUX_MIB_XFRMINSEQOUTOFWINDOW,         /* XfrmInSeqOutOfWindow */
+       LINUX_MIB_XFRMINSTATESEQERROR,          /* XfrmInStateSeqError */
        LINUX_MIB_XFRMINSTATEEXPIRED,           /* XfrmInStateExpired */
        LINUX_MIB_XFRMINSTATEMISMATCH,          /* XfrmInStateMismatch */
        LINUX_MIB_XFRMINSTATEINVALID,           /* XfrmInStateInvalid */
@@ -241,6 +241,7 @@ enum
        LINUX_MIB_XFRMOUTNOSTATES,              /* XfrmOutNoStates */
        LINUX_MIB_XFRMOUTSTATEPROTOERROR,       /* XfrmOutStateProtoError */
        LINUX_MIB_XFRMOUTSTATEMODEERROR,        /* XfrmOutStateModeError */
+       LINUX_MIB_XFRMOUTSTATESEQERROR,         /* XfrmOutStateSeqError */
        LINUX_MIB_XFRMOUTSTATEEXPIRED,          /* XfrmOutStateExpired */
        LINUX_MIB_XFRMOUTPOLBLOCK,              /* XfrmOutPolBlock */
        LINUX_MIB_XFRMOUTPOLDEAD,               /* XfrmOutPolDead */
index d32b67a4e0fd516a7045ab440e2bfa568dfc5f73..4d6ebc633a944d14a328606ee675ae5cc528e191 100644 (file)
@@ -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, skb, seq)) {
-                       XFRM_INC_STATS(LINUX_MIB_XFRMINSEQOUTOFWINDOW);
+                       XFRM_INC_STATS(LINUX_MIB_XFRMINSTATESEQERROR);
                        goto drop_unlock;
                }
 
index f4a1047a55737929efd37f989c53fc18adea6b53..fc690368325f6b86c0ee7b1e74a16ac442b3965d 100644 (file)
@@ -64,6 +64,7 @@ static int xfrm_output_one(struct sk_buff *skb, int err)
                if (x->type->flags & XFRM_TYPE_REPLAY_PROT) {
                        XFRM_SKB_CB(skb)->seq = ++x->replay.oseq;
                        if (unlikely(x->replay.oseq == 0)) {
+                               XFRM_INC_STATS(LINUX_MIB_XFRMOUTSTATESEQERROR);
                                x->replay.oseq--;
                                xfrm_audit_state_replay_overflow(x, skb);
                                err = -EOVERFLOW;
index 31d035415ecd2e155b77cad6937b039b09341455..2b0db13f0cda681c9482e86a97a51cf6f9f660d4 100644 (file)
@@ -22,7 +22,7 @@ static struct snmp_mib xfrm_mib_list[] = {
        SNMP_MIB_ITEM("XfrmInNoStates", LINUX_MIB_XFRMINNOSTATES),
        SNMP_MIB_ITEM("XfrmInStateProtoError", LINUX_MIB_XFRMINSTATEPROTOERROR),
        SNMP_MIB_ITEM("XfrmInStateModeError", LINUX_MIB_XFRMINSTATEMODEERROR),
-       SNMP_MIB_ITEM("XfrmInSeqOutOfWindow", LINUX_MIB_XFRMINSEQOUTOFWINDOW),
+       SNMP_MIB_ITEM("XfrmInStateSeqError", LINUX_MIB_XFRMINSTATESEQERROR),
        SNMP_MIB_ITEM("XfrmInStateExpired", LINUX_MIB_XFRMINSTATEEXPIRED),
        SNMP_MIB_ITEM("XfrmInStateMismatch", LINUX_MIB_XFRMINSTATEMISMATCH),
        SNMP_MIB_ITEM("XfrmInStateInvalid", LINUX_MIB_XFRMINSTATEINVALID),
@@ -36,6 +36,7 @@ static struct snmp_mib xfrm_mib_list[] = {
        SNMP_MIB_ITEM("XfrmOutNoStates", LINUX_MIB_XFRMOUTNOSTATES),
        SNMP_MIB_ITEM("XfrmOutStateProtoError", LINUX_MIB_XFRMOUTSTATEPROTOERROR),
        SNMP_MIB_ITEM("XfrmOutStateModeError", LINUX_MIB_XFRMOUTSTATEMODEERROR),
+       SNMP_MIB_ITEM("XfrmOutStateSeqError", LINUX_MIB_XFRMOUTSTATESEQERROR),
        SNMP_MIB_ITEM("XfrmOutStateExpired", LINUX_MIB_XFRMOUTSTATEEXPIRED),
        SNMP_MIB_ITEM("XfrmOutPolBlock", LINUX_MIB_XFRMOUTPOLBLOCK),
        SNMP_MIB_ITEM("XfrmOutPolDead", LINUX_MIB_XFRMOUTPOLDEAD),