Skip site navigation (1)Skip section navigation (2)
Date:      Mon, 24 Aug 2015 21:41:06 +0000 (UTC)
From:      Luiz Otavio O Souza <loos@FreeBSD.org>
To:        src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org
Subject:   svn commit: r287119 - head/sys/netpfil/pf
Message-ID:  <201508242141.t7OLf6wC048026@repo.freebsd.org>

next in thread | raw e-mail | index | archive | help
Author: loos
Date: Mon Aug 24 21:41:05 2015
New Revision: 287119
URL: https://svnweb.freebsd.org/changeset/base/287119

Log:
  Reapply r196551 which was accidentally reverted by r223637 (update to
  OpenBSD pf 4.5).
  
  Fix argument ordering to memcpy as well as the size of the copy in the
  (theoretical) case that pfi_buffer_cnt should be greater than ~_max.
  
  This fix the failure when you hit the self table size and force it to be
  resized.
  
  MFC after:	3 days
  Sponsored by:	Rubicon Communications (Netgate)

Modified:
  head/sys/netpfil/pf/pf_if.c

Modified: head/sys/netpfil/pf/pf_if.c
==============================================================================
--- head/sys/netpfil/pf/pf_if.c	Mon Aug 24 20:39:22 2015	(r287118)
+++ head/sys/netpfil/pf/pf_if.c	Mon Aug 24 21:41:05 2015	(r287119)
@@ -581,7 +581,7 @@ pfi_address_add(struct sockaddr *sa, int
 			    __func__, V_pfi_buffer_cnt, PFI_BUFFER_MAX);
 			return;
 		}
-		memcpy(V_pfi_buffer, p, V_pfi_buffer_cnt * sizeof(*V_pfi_buffer));
+		memcpy(p, V_pfi_buffer, V_pfi_buffer_max * sizeof(*V_pfi_buffer));
 		/* no need to zero buffer */
 		free(V_pfi_buffer, PFI_MTYPE);
 		V_pfi_buffer = p;



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