From owner-svn-src-head@FreeBSD.ORG Sun Mar 21 15:54:07 2010 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id B6393106566C; Sun, 21 Mar 2010 15:54:07 +0000 (UTC) (envelope-from luigi@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 8BAC78FC1A; Sun, 21 Mar 2010 15:54:07 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id o2LFs7Ir046854; Sun, 21 Mar 2010 15:54:07 GMT (envelope-from luigi@svn.freebsd.org) Received: (from luigi@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o2LFs7HC046851; Sun, 21 Mar 2010 15:54:07 GMT (envelope-from luigi@svn.freebsd.org) Message-Id: <201003211554.o2LFs7HC046851@svn.freebsd.org> From: Luigi Rizzo Date: Sun, 21 Mar 2010 15:54:07 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r205415 - head/sys/netinet/ipfw X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 21 Mar 2010 15:54:07 -0000 Author: luigi Date: Sun Mar 21 15:54:07 2010 New Revision: 205415 URL: http://svn.freebsd.org/changeset/base/205415 Log: no need for ipfw_flush_tables(), we just need ipfw_destroy_tables() Modified: head/sys/netinet/ipfw/ip_fw_private.h head/sys/netinet/ipfw/ip_fw_table.c Modified: head/sys/netinet/ipfw/ip_fw_private.h ============================================================================== --- head/sys/netinet/ipfw/ip_fw_private.h Sun Mar 21 15:52:55 2010 (r205414) +++ head/sys/netinet/ipfw/ip_fw_private.h Sun Mar 21 15:54:07 2010 (r205415) @@ -274,7 +274,6 @@ int ipfw_lookup_table(struct ip_fw_chain int ipfw_init_tables(struct ip_fw_chain *ch); void ipfw_destroy_tables(struct ip_fw_chain *ch); int ipfw_flush_table(struct ip_fw_chain *ch, uint16_t tbl); -void ipfw_flush_tables(struct ip_fw_chain *ch); int ipfw_add_table_entry(struct ip_fw_chain *ch, uint16_t tbl, in_addr_t addr, uint8_t mlen, uint32_t value); int ipfw_dump_table_entry(struct radix_node *rn, void *arg); Modified: head/sys/netinet/ipfw/ip_fw_table.c ============================================================================== --- head/sys/netinet/ipfw/ip_fw_table.c Sun Mar 21 15:52:55 2010 (r205414) +++ head/sys/netinet/ipfw/ip_fw_table.c Sun Mar 21 15:54:07 2010 (r205415) @@ -176,14 +176,18 @@ ipfw_flush_table(struct ip_fw_chain *ch, } void -ipfw_flush_tables(struct ip_fw_chain *ch) +ipfw_destroy_tables(struct ip_fw_chain *ch) { uint16_t tbl; + struct radix_node_head *rnh; IPFW_WLOCK_ASSERT(ch); - for (tbl = 0; tbl < IPFW_TABLES_MAX; tbl++) + for (tbl = 0; tbl < IPFW_TABLES_MAX; tbl++) { ipfw_flush_table(ch, tbl); + rnh = ch->tables[tbl]; + rn_detachhead((void **)&rnh); + } } int @@ -203,21 +207,6 @@ ipfw_init_tables(struct ip_fw_chain *ch) return (0); } -void -ipfw_destroy_tables(struct ip_fw_chain *ch) -{ - int tbl; - struct radix_node_head *rnh; - - IPFW_WLOCK_ASSERT(ch); - - ipfw_flush_tables(ch); - for (tbl = 0; tbl < IPFW_TABLES_MAX; tbl++) { - rnh = ch->tables[tbl]; - rn_detachhead((void **)&rnh); - } -} - int ipfw_lookup_table(struct ip_fw_chain *ch, uint16_t tbl, in_addr_t addr, uint32_t *val)