From owner-svn-src-head@FreeBSD.ORG Thu Feb 5 14:54:54 2015 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 44E676A0; Thu, 5 Feb 2015 14:54:54 +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 309BB85A; Thu, 5 Feb 2015 14:54:54 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.9/8.14.9) with ESMTP id t15Ess6O064655; Thu, 5 Feb 2015 14:54:54 GMT (envelope-from melifaro@FreeBSD.org) Received: (from melifaro@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id t15Essxh064654; Thu, 5 Feb 2015 14:54:54 GMT (envelope-from melifaro@FreeBSD.org) Message-Id: <201502051454.t15Essxh064654@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: melifaro set sender to melifaro@FreeBSD.org using -f From: "Alexander V. Chernikov" Date: Thu, 5 Feb 2015 14:54:54 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r278264 - head/sys/netpfil/ipfw X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.18-1 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: Thu, 05 Feb 2015 14:54:54 -0000 Author: melifaro Date: Thu Feb 5 14:54:53 2015 New Revision: 278264 URL: https://svnweb.freebsd.org/changeset/base/278264 Log: Fix IP_FW_NAT44_LIST_NAT size calculation. Found by: lev Sponsored by: Yandex LLC Modified: head/sys/netpfil/ipfw/ip_fw_nat.c Modified: head/sys/netpfil/ipfw/ip_fw_nat.c ============================================================================== --- head/sys/netpfil/ipfw/ip_fw_nat.c Thu Feb 5 14:12:05 2015 (r278263) +++ head/sys/netpfil/ipfw/ip_fw_nat.c Thu Feb 5 14:54:53 2015 (r278264) @@ -691,7 +691,7 @@ nat44_get_cfg(struct ip_fw_chain *chain, export_nat_cfg(ptr, ucfg); /* Estimate memory amount */ - sz = sizeof(struct nat44_cfg_nat); + sz = sizeof(ipfw_obj_header) + sizeof(struct nat44_cfg_nat); LIST_FOREACH(r, &ptr->redir_chain, _next) { sz += sizeof(struct nat44_cfg_redir); LIST_FOREACH(s, &r->spool_chain, _next) @@ -699,7 +699,7 @@ nat44_get_cfg(struct ip_fw_chain *chain, } ucfg->size = sz; - if (sd->valsize < sz + sizeof(*oh)) { + if (sd->valsize < sz) { /* * Submitted buffer size is not enough.