netdev.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [RFC PATCH net-next-2.6]: xfrm: Introduce LINUX_MIB_XFRMFWDHDRERROR
@ 2010-02-17 11:40 jamal
  2010-02-17 21:49 ` David Miller
  0 siblings, 1 reply; 4+ messages in thread
From: jamal @ 2010-02-17 11:40 UTC (permalink / raw)
  To: David Miller; +Cc: Masahide NAKAMURA, Patrick McHardy, herbert, netdev

[-- Attachment #1: Type: text/plain, Size: 332 bytes --]


I had a hard time debugging some setup while testing xfrm by mark
in presence of traffic being forwarded as well as being locally 
terminated. This change helped narrow things down a little for me.
The danger is that it changes the /proc output which may break some
user space tool (thats why i have it as an RFC).

cheers,
jamal 

[-- Attachment #2: FwdHdrErr --]
[-- Type: text/plain, Size: 2080 bytes --]

commit cba12a140f1c4cad34f55d1b01067c2d83ee0748
Author: Jamal Hadi Salim <hadi@cyberus.ca>
Date:   Wed Feb 17 06:26:52 2010 -0500

    xfrm: Introduce LINUX_MIB_XFRMFWDHDRERROR
    
    XFRMINHDRERROR counter is ambigous when validating forwarding
    path. It makes it tricky to debug when you have both in and fwd
    validation.
    
    Signed-off-by: Jamal Hadi Salim <hadi@cyberus.ca>

diff --git a/include/linux/snmp.h b/include/linux/snmp.h
index 0f953fe..8522120 100644
--- a/include/linux/snmp.h
+++ b/include/linux/snmp.h
@@ -246,6 +246,7 @@ enum
 	LINUX_MIB_XFRMINNOPOLS,			/* XfrmInNoPols */
 	LINUX_MIB_XFRMINPOLBLOCK,		/* XfrmInPolBlock */
 	LINUX_MIB_XFRMINPOLERROR,		/* XfrmInPolError */
+	LINUX_MIB_XFRMFWDHDRERROR,		/* XfrmFwdHdrError*/
 	LINUX_MIB_XFRMOUTERROR,			/* XfrmOutError */
 	LINUX_MIB_XFRMOUTBUNDLEGENERROR,	/* XfrmOutBundleGenError */
 	LINUX_MIB_XFRMOUTBUNDLECHECKERROR,	/* XfrmOutBundleCheckError */
diff --git a/net/xfrm/xfrm_policy.c b/net/xfrm/xfrm_policy.c
index eb870fc..916784d 100644
--- a/net/xfrm/xfrm_policy.c
+++ b/net/xfrm/xfrm_policy.c
@@ -2052,8 +2052,7 @@ int __xfrm_route_forward(struct sk_buff *skb, unsigned short family)
 	int res;
 
 	if (xfrm_decode_session(skb, &fl, family) < 0) {
-		/* XXX: we should have something like FWDHDRERROR here. */
-		XFRM_INC_STATS(net, LINUX_MIB_XFRMINHDRERROR);
+		XFRM_INC_STATS(net, LINUX_MIB_XFRMFWDHDRERROR);
 		return 0;
 	}
 
diff --git a/net/xfrm/xfrm_proc.c b/net/xfrm/xfrm_proc.c
index c083a4e..289992a 100644
--- a/net/xfrm/xfrm_proc.c
+++ b/net/xfrm/xfrm_proc.c
@@ -30,6 +30,7 @@ static const struct snmp_mib xfrm_mib_list[] = {
 	SNMP_MIB_ITEM("XfrmInNoPols", LINUX_MIB_XFRMINNOPOLS),
 	SNMP_MIB_ITEM("XfrmInPolBlock", LINUX_MIB_XFRMINPOLBLOCK),
 	SNMP_MIB_ITEM("XfrmInPolError", LINUX_MIB_XFRMINPOLERROR),
+	SNMP_MIB_ITEM("XfrmFwdHdrError", LINUX_MIB_XFRMFWDHDRERROR),
 	SNMP_MIB_ITEM("XfrmOutError", LINUX_MIB_XFRMOUTERROR),
 	SNMP_MIB_ITEM("XfrmOutBundleGenError", LINUX_MIB_XFRMOUTBUNDLEGENERROR),
 	SNMP_MIB_ITEM("XfrmOutBundleCheckError", LINUX_MIB_XFRMOUTBUNDLECHECKERROR),

^ permalink raw reply related	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2010-02-18 23:44 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2010-02-17 11:40 [RFC PATCH net-next-2.6]: xfrm: Introduce LINUX_MIB_XFRMFWDHDRERROR jamal
2010-02-17 21:49 ` David Miller
2010-02-18 13:35   ` jamal
2010-02-18 23:44     ` David Miller

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).