Skip site navigation (1)Skip section navigation (2)
Date:      Thu, 19 Jul 2018 07:30:19 +0000 (UTC)
From:      "Andrey V. Elsukov" <ae@FreeBSD.org>
To:        src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-11@freebsd.org
Subject:   svn commit: r336468 - stable/11/sys/netpfil/ipfw
Message-ID:  <201807190730.w6J7UJrx042326@repo.freebsd.org>

next in thread | raw e-mail | index | archive | help
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,



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