Skip site navigation (1)Skip section navigation (2)
Date:      Thu, 5 Feb 2015 14:54:54 +0000 (UTC)
From:      "Alexander V. Chernikov" <melifaro@FreeBSD.org>
To:        src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org
Subject:   svn commit: r278264 - head/sys/netpfil/ipfw
Message-ID:  <201502051454.t15Essxh064654@svn.freebsd.org>

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



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