Skip site navigation (1)Skip section navigation (2)
Date:      Thu, 31 May 2012 20:10:05 +0000 (UTC)
From:      Ermal Luçi <eri@FreeBSD.org>
To:        src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org
Subject:   svn commit: r236364 - head/sys/contrib/pf/net
Message-ID:  <201205312010.q4VKA5Ys061986@svn.freebsd.org>

next in thread | raw e-mail | index | archive | help
Author: eri
Date: Thu May 31 20:10:05 2012
New Revision: 236364
URL: http://svn.freebsd.org/changeset/base/236364

Log:
  Correct table counter functionality to not  panic.
  This was caused by not proper initialization of necessary parameters.
  
  PR: 168200
  Reviewed by:	bz@, glebius@
  MFC after:	1 week

Modified:
  head/sys/contrib/pf/net/pf_ioctl.c
  head/sys/contrib/pf/net/pf_table.c
  head/sys/contrib/pf/net/pfvar.h

Modified: head/sys/contrib/pf/net/pf_ioctl.c
==============================================================================
--- head/sys/contrib/pf/net/pf_ioctl.c	Thu May 31 19:34:53 2012	(r236363)
+++ head/sys/contrib/pf/net/pf_ioctl.c	Thu May 31 20:10:05 2012	(r236364)
@@ -298,7 +298,7 @@ init_zone_var(void)
 	V_pf_altq_pl = V_pf_pooladdr_pl = NULL;
 	V_pf_frent_pl = V_pf_frag_pl = V_pf_cache_pl = V_pf_cent_pl = NULL;
 	V_pf_state_scrub_pl = NULL;
-	V_pfr_ktable_pl = V_pfr_kentry_pl = NULL;
+	V_pfr_ktable_pl = V_pfr_kentry_pl = V_pfr_kcounters_pl = NULL;
 }
 
 void
@@ -317,6 +317,7 @@ cleanup_pf_zone(void)
 	UMA_DESTROY(V_pf_cent_pl);
 	UMA_DESTROY(V_pfr_ktable_pl);
 	UMA_DESTROY(V_pfr_kentry_pl);
+	UMA_DESTROY(V_pfr_kcounters_pl);
 	UMA_DESTROY(V_pf_state_scrub_pl);
 	UMA_DESTROY(V_pfi_addr_pl);
 }
@@ -337,6 +338,7 @@ pfattach(void)
 		UMA_CREATE(V_pf_pooladdr_pl,	struct pf_pooladdr, "pfpooladdrpl");
 		UMA_CREATE(V_pfr_ktable_pl,	struct pfr_ktable, "pfrktable");
 		UMA_CREATE(V_pfr_kentry_pl,	struct pfr_kentry, "pfrkentry");
+		UMA_CREATE(V_pfr_kcounters_pl,	struct pfr_kcounters, "pfrkcounters");
 		UMA_CREATE(V_pf_frent_pl,	struct pf_frent, "pffrent");
 		UMA_CREATE(V_pf_frag_pl,	struct pf_fragment, "pffrag");
 		UMA_CREATE(V_pf_cache_pl,	struct pf_fragment, "pffrcache");

Modified: head/sys/contrib/pf/net/pf_table.c
==============================================================================
--- head/sys/contrib/pf/net/pf_table.c	Thu May 31 19:34:53 2012	(r236363)
+++ head/sys/contrib/pf/net/pf_table.c	Thu May 31 20:10:05 2012	(r236364)
@@ -179,7 +179,6 @@ struct pfr_walktree {
 VNET_DEFINE(uma_zone_t,			pfr_ktable_pl);
 VNET_DEFINE(uma_zone_t,			pfr_kentry_pl);
 VNET_DEFINE(uma_zone_t,			pfr_kcounters_pl);
-#define	V_pfr_kcounters_pl		VNET(pfr_kcounters_pl)
 VNET_DEFINE(struct sockaddr_in,		pfr_sin);
 #define	V_pfr_sin			VNET(pfr_sin)
 VNET_DEFINE(struct sockaddr_in6,	pfr_sin6);

Modified: head/sys/contrib/pf/net/pfvar.h
==============================================================================
--- head/sys/contrib/pf/net/pfvar.h	Thu May 31 19:34:53 2012	(r236363)
+++ head/sys/contrib/pf/net/pfvar.h	Thu May 31 20:10:05 2012	(r236364)
@@ -1868,6 +1868,8 @@ VNET_DECLARE(uma_zone_t,		 pfr_ktable_pl
 #define	V_pfr_ktable_pl			 VNET(pfr_ktable_pl)
 VNET_DECLARE(uma_zone_t,		 pfr_kentry_pl);
 #define	V_pfr_kentry_pl			 VNET(pfr_kentry_pl)
+VNET_DECLARE(uma_zone_t,		 pfr_kcounters_pl);
+#define	V_pfr_kcounters_pl		 VNET(pfr_kcounters_pl)
 VNET_DECLARE(uma_zone_t,		 pf_cache_pl);
 #define	V_pf_cache_pl			 VNET(pf_cache_pl)
 VNET_DECLARE(uma_zone_t,		 pf_cent_pl);



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?201205312010.q4VKA5Ys061986>