svn commit: r336468 - stable/11/sys/netpfil/ipfw

Andrey V. Elsukov ae at FreeBSD.org
Thu Jul 19 07:30:20 UTC 2018


Author: ae
Date: Thu Jul 19 07:30:18 2018
New Revision: 336468
URL: https://svnweb.freebsd.org/changeset/base/336468

Log:
  MFC r336219:
    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

Modified:
  stable/11/sys/netpfil/ipfw/ip_fw_sockopt.c
Directory Properties:
  stable/11/   (props changed)

Modified: stable/11/sys/netpfil/ipfw/ip_fw_sockopt.c
==============================================================================
--- stable/11/sys/netpfil/ipfw/ip_fw_sockopt.c	Thu Jul 19 04:31:41 2018	(r336467)
+++ stable/11/sys/netpfil/ipfw/ip_fw_sockopt.c	Thu Jul 19 07:30:18 2018	(r336468)
@@ -299,10 +299,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,


More information about the svn-src-all mailing list