From owner-svn-src-projects@FreeBSD.ORG Fri Aug 1 08:39:48 2014 Return-Path: Delivered-To: svn-src-projects@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 67AAFF3F; Fri, 1 Aug 2014 08:39:48 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 3B9EB2B00; Fri, 1 Aug 2014 08:39:48 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.9/8.14.9) with ESMTP id s718dmuj059140; Fri, 1 Aug 2014 08:39:48 GMT (envelope-from melifaro@svn.freebsd.org) Received: (from melifaro@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id s718dmon059139; Fri, 1 Aug 2014 08:39:48 GMT (envelope-from melifaro@svn.freebsd.org) Message-Id: <201408010839.s718dmon059139@svn.freebsd.org> From: "Alexander V. Chernikov" Date: Fri, 1 Aug 2014 08:39:48 +0000 (UTC) To: src-committers@freebsd.org, svn-src-projects@freebsd.org Subject: svn commit: r269372 - projects/ipfw/sys/netpfil/ipfw X-SVN-Group: projects MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-projects@freebsd.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: "SVN commit messages for the src " projects" tree" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 01 Aug 2014 08:39:48 -0000 Author: melifaro Date: Fri Aug 1 08:39:47 2014 New Revision: 269372 URL: http://svnweb.freebsd.org/changeset/base/269372 Log: Do not perform memset() on ta_buf in algo callbacks: it is already zeroed by base code. Modified: projects/ipfw/sys/netpfil/ipfw/ip_fw_table_algo.c Modified: projects/ipfw/sys/netpfil/ipfw/ip_fw_table_algo.c ============================================================================== --- projects/ipfw/sys/netpfil/ipfw/ip_fw_table_algo.c Fri Aug 1 08:28:18 2014 (r269371) +++ projects/ipfw/sys/netpfil/ipfw/ip_fw_table_algo.c Fri Aug 1 08:39:47 2014 (r269372) @@ -266,9 +266,9 @@ ta_foreach_radix(void *ta_state, struct struct ta_buf_cidr { + void *ent_ptr; struct sockaddr *addr_ptr; struct sockaddr *mask_ptr; - void *ent_ptr; union { struct { struct sockaddr_in sa; @@ -352,7 +352,6 @@ ta_prepare_add_cidr(struct ip_fw_chain * int mlen, set_mask; tb = (struct ta_buf_cidr *)ta_buf; - memset(tb, 0, sizeof(struct ta_buf_cidr)); mlen = tei->masklen; set_mask = 0; @@ -460,7 +459,6 @@ ta_prepare_del_cidr(struct ip_fw_chain * int mlen, set_mask; tb = (struct ta_buf_cidr *)ta_buf; - memset(tb, 0, sizeof(struct ta_buf_cidr)); mlen = tei->masklen; set_mask = 0; @@ -1103,7 +1101,6 @@ ta_prepare_add_chash(struct ip_fw_chain int error; tb = (struct ta_buf_chash *)ta_buf; - memset(tb, 0, sizeof(struct ta_buf_chash)); ent = malloc(sizeof(*ent), M_IPFW_TBL, M_WAITOK | M_ZERO); @@ -1196,7 +1193,6 @@ ta_prepare_del_chash(struct ip_fw_chain struct ta_buf_chash *tb; tb = (struct ta_buf_chash *)ta_buf; - memset(tb, 0, sizeof(struct ta_buf_chash)); return (tei_to_chash_ent(tei, &tb->ent)); } @@ -1657,7 +1653,6 @@ ta_prepare_add_ifidx(struct ip_fw_chain struct ifentry *ife; tb = (struct ta_buf_ifidx *)ta_buf; - memset(tb, 0, sizeof(struct ta_buf_ifidx)); /* Check if string is terminated */ ifname = (char *)tei->paddr; @@ -1750,7 +1745,6 @@ ta_prepare_del_ifidx(struct ip_fw_chain char *ifname; tb = (struct ta_buf_ifidx *)ta_buf; - memset(tb, 0, sizeof(struct ta_buf_ifidx)); /* Check if string is terminated */ ifname = (char *)tei->paddr; @@ -2179,7 +2173,6 @@ ta_prepare_add_numarray(struct ip_fw_cha struct ta_buf_numarray *tb; tb = (struct ta_buf_numarray *)ta_buf; - memset(tb, 0, sizeof(*tb)); tb->na.number = *((uint32_t *)tei->paddr); tb->na.value = tei->value; @@ -2836,7 +2829,6 @@ ta_prepare_add_fhash(struct ip_fw_chain int error; tb = (struct ta_buf_fhash *)ta_buf; - memset(tb, 0, sizeof(struct ta_buf_fhash)); if (tei->subtype == AF_INET) sz = sizeof(struct fhashentry4); @@ -2919,7 +2911,6 @@ ta_prepare_del_fhash(struct ip_fw_chain struct ta_buf_fhash *tb; tb = (struct ta_buf_fhash *)ta_buf; - memset(tb, 0, sizeof(struct ta_buf_fhash)); return (tei_to_fhash_ent(tei, &tb->fe6.e)); }