Skip site navigation (1)Skip section navigation (2)
Date:      Thu, 12 Jul 2018 11:38:18 +0000 (UTC)
From:      "Andrey V. Elsukov" <ae@FreeBSD.org>
To:        src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org
Subject:   svn commit: r336219 - head/sys/netpfil/ipfw
Message-ID:  <201807121138.w6CBcIDA092510@repo.freebsd.org>

next in thread | raw e-mail | index | archive | help
Author: ae
Date: Thu Jul 12 11:38:18 2018
New Revision: 336219
URL: https://svnweb.freebsd.org/changeset/base/336219

Log:
  Use correct size when we are allocating array for skipto index.
  
  Also, there is no need to use M_ZERO for idxmap_back. It will be
  re-filled just after allocation in update_skipto_cache().
  
  PR:		229665
  MFC after:	1 week

Modified:
  head/sys/netpfil/ipfw/ip_fw_sockopt.c

Modified: head/sys/netpfil/ipfw/ip_fw_sockopt.c
==============================================================================
--- head/sys/netpfil/ipfw/ip_fw_sockopt.c	Thu Jul 12 05:37:52 2018	(r336218)
+++ head/sys/netpfil/ipfw/ip_fw_sockopt.c	Thu Jul 12 11:38:18 2018	(r336219)
@@ -301,10 +301,8 @@ ipfw_init_skipto_cache(struct ip_fw_chain *chain)
 {
 	int *idxmap, *idxmap_back;
 
-	idxmap = malloc(65536 * sizeof(uint32_t *), M_IPFW,
-	    M_WAITOK | M_ZERO);
-	idxmap_back = malloc(65536 * sizeof(uint32_t *), M_IPFW,
-	    M_WAITOK | M_ZERO);
+	idxmap = malloc(65536 * sizeof(int), M_IPFW, M_WAITOK | M_ZERO);
+	idxmap_back = malloc(65536 * sizeof(int), M_IPFW, M_WAITOK);
 
 	/*
 	 * Note we may be called at any time after initialization,



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